PrismaP
Prisma14mo ago
arsh.bakh

Error

I get a error on my data when i create a user and i saw some blogs where its cus i have information i have mandated to setup but I dont understand what it is since i basically made everything possibly optional.

This is the error ype '{ email: string; balance: number; username: string; }' is not assignable to type '(Without<UserCreateInput, UserUncheckedCreateInput> & UserUncheckedCreateInput)

   const user =  await prisma.user.create({
       data:{
        email: "arsh@example.com",
        balance : 0.00,
        username : "arshbakh",
       }
    })


model Bet {
  id Int @id @default(autoincrement())

  placedDate    DateTime? @default(now())
  updateDate    DateTime? @updatedAt
  team1         String?
  team2         String?
  amount        Float?
  winningAmount Float?
  status        String?
  odds          Float?

  //many bets to one user
  user   User? @relation(fields: [userId], references: [id])
  userId Int?  

  //many bets to one agent 
  agent   Agent? @relation(fields: [agentId], references: [id])
  agentId Int?
}


whats my issue?
Was this page helpful?