Ivan Lukianchuk
08/04/2021, 8:03 PMticketId
in data.ticketId for type TemplateItemCreateInput. Did you mean ticket
?
Argument ticket for data.ticket is missing.
const creation = await prisma.templateItem.create({
data: {
ticketId: ticket.id
}
});
And here is the simplified schema:
model TemplateItem {
id Int @id @default(autoincrement())
ticket Ticket @relation(fields: [ticketId], references: [id])
ticketId Int
}
model Ticket {
id Int @id @default(autoincrement())
templateTicketId TemplateItem?
}
I've removed extra stuff that isn't important to simplify the code
So if I've got a 1-1 relationship setup, why won't it let me pass in the ticketId? It sounds like it doesn't even understand that it's in the schema, yet it's clearly there and worked before. Am I missing something or did something change?
I want to make a TemplateItem and reference the id of the existing Ticket.