So, I have two collection
Beat <-> Client
case 1:-
When there is no Clients Document linked to Beat meaning, if we check how many document linked to beat then it will result in 0. And, Then when you try to send update req it success and we get 200.
req body :-
json
{"data":{"beatName":"Test","beatNumber":5,"beatDay":"thursday","startLocation":"Test","endLocation":"Test"}}
reponse body
json
{"beatName":"Test","beatNumber":5,"endLocation":"Test","startLocation":"Test","beatDay":"thursday","$id":"64651e78e52661b666a1","$createdAt":"2023-05-17T18:35:36.939+00:00","$updatedAt":"2023-05-18T07:21:37.937+00:00","$permissions":[],"clientLink":[],"$databaseId":"6451d90b58e5630094e5","$collectionId":"645c9e293be3c3ee04e1"}
case 2:- When there is 1 or more Clients Document linked to Beat meaning, if we check how many document linked to beat then it will result in >0. And, Then when you try to send update req it success and we get 401, req body
{"data":{"beatName":"Test","beatNumber":5,"beatDay":"sunday","startLocation":"Test","endLocation":"Test"}}
resp body
{"message":"The current user is not authorized to perform the requested action.","code":401,"type":"user_unauthorized","version":"1.3.4"}
Things that that doubled checked,
- granted update permission to both document to all registered users.
Additional Note:- Relationship type is 2 ways, and One to Many from beat to client.
Patch Request, return 401 if some document have been linked
What are the permissions on client collection?
Any user can update/create/read
Does the client collection have any relationship attributes?
yap with 👀
So what are the collection permissions on those?
😬
phone
address
Ya missing update. That's probably why
umm, does why is that I wonder, I mean I don't think it's ideal right?
because want to only need to update the specific collection only and not all sub-related collection
Yes, this is the related issue: https://github.com/appwrite/appwrite/issues/5404
Recommended threads
- Query params are way too limiting in ter...
I was trying to list rows in a table that do not already exist in another table. I retrieved around 260 row IDs which are 13 characters in length each, and then...
- Relationship null, even when relationshi...
Hi Everyone, im experiencing issues with set relation data. When im setting the document id from the related database most of them seem fine, except one table. ...
- REQUEST FAILED IN MIGRATION
I was trying to moved my archived project to a self-host database . Though the Project is "read only" but there's a message that I can view and migrate data to...