docs icon indicating copy to clipboard operation
docs copied to clipboard

Fix code snippet won't compile issue

Open onlyice opened this issue 1 year ago • 2 comments

The original code won't compile with TS compiler, due to the missing field content in the data. Add the field to eliminate compiler error.

onlyice avatar Apr 25 '24 03:04 onlyice

@onlyice is attempting to deploy a commit to the Prisma Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Apr 25 '24 03:04 vercel[bot]

Hi @onlyice ,

That shouldn't be the case. The Post model's content field is marked as optional:

model Post {
  id        Int     @id @default(autoincrement())
  title     String
  content   String?
  published Boolean @default(false)
  author    User    @relation(fields: [authorId], references: [id])
  authorId  Int
}

Could you confirm that your model is set up correctly?

jharrell avatar May 01 '24 16:05 jharrell

Hi @jharrell, I can confirm that the problem is caused by the reason you stated. Thanks for your reply.

onlyice avatar May 08 '24 10:05 onlyice