#This does not work
await prisma.user.create({
data: {
....,
post: {
connect: { id: post_id }
}
}
}
#Potential solution
const user = await prisma.user.create({
data: {
....,
}
}
await prisma.user.update({
where: {
id: user.id
},
post: {
connect: { id: post_id }
}
})
#This does not work
await prisma.user.create({
data: {
....,
post: {
connect: { id: post_id }
}
}
}
#Potential solution
const user = await prisma.user.create({
data: {
....,
}
}
await prisma.user.update({
where: {
id: user.id
},
post: {
connect: { id: post_id }
}
})