karolis
07/13/2022, 6:43 PMamenity
from particular chalet
Is this is how I do it?
await prisma.chalet.update({ where: { id }, data:{ amenities: { disconnect:{ id }}}});
Can/should I do it other way around? (disconnecting chalet from amenity)? I'm confused
What my rest api route should look like? do I target chalet
or amenity
?
My sample schema:
model Chalet {
id String @id @unique @default(cuid())
bookings Booking[]
reviews Review[]
amenities Amenity[]
}
Yuval Datner
07/13/2022, 9:21 PM