Junyu Yang
06/15/2022, 11:48 PMconst pendingRequest = await prisma.connection_request.findFirst({
where: {
initiator_id: targetUserProfileId,
requested_id: authUserProfileId,
}
})
But throw error
Type ‘{ initiator_id: any; requested_id: number; }’ is not assignable to type ‘connection_requestWhereUniqueInput’.
Object literal may only specify known properties, and ‘initiator_id’ does not exist in type ‘connection_requestWhereUniqueInput’.
when I do
await prisma.connection_request.update({
where: {
initiator_id: targetUserProfileId,
requested_id: authUserProfileId,
},
data: {
confirmed_at: new Date(),
},
})
How can I fix it?Nurul
06/16/2022, 6:50 AMupdate
query should point to a unique record. So combination of `initator_id`and requested_id
should be unique.
Just to confirm, your PrismaClient is in sync with Prisma Schema, right?