Rank 3: Container
I'm getting 500 error on creating document with relationship
Votes
1
Replies
17
Participants
Unknown
Messages
18
Rank 3: Container
I'm getting 500 error on creating document with relationship
What do the docker logs for the appwrite container say for the 500 error?
Also, what's your code?
Rank 3: Container
await database.createDocument(
databaseId: [DB ID],
collectionId: [Collection ID],
documentId: ID.unique(),
data: {
"user_id": userId,
"product_id": [productId],
"quantity": 1,
},
);
Rank 3: Container
code
Rank 3: Container
docker log
Rank 3: Container
It's a little hard to read because its cut off but it looks like a permission problem. Does the user have update access to the related document?
Moderator
Looks like it doesn't has update permission
Rank 3: Container
i have updated the permission
Rank 3: Container
but it showed this
What are the permissions on product and does product have any other related documents?
Rank 3: Container
i haven't added permission on the products to create for this user but only for carts
The user needs access to every related document
Rank 3: Container
to create carts, i'll need to add create access on my products table as well?
If the user is creating a document in that collection, then yes
Rank 3: Container
I'm creating document on carts table not on products
Rank 3: Container
and i have create access on carts
Ok so?