Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This always returns the first row in the profile document. #4

Open
CiaranPearse opened this issue Aug 6, 2023 · 1 comment
Open

Comments

@CiaranPearse
Copy link

const { documents } = await databases.listDocuments<AppwriteProfile>("main", "profile", [Query.limit(1)]);

What are the permissions setting for this document? Without correct permissions this will always return the first entry in the document regardless of which account is signed in

@alexbacanu
Copy link
Owner

When the user profile is created, the document permissions are set to be read only by the user who initiated it.

The permissions are granted here:
https://github.com/alexbacanu/recommen.do-functions/blob/main/functions/create-profile/src/index.js#L112

So yes, the query will always return the first entry, but each user should see their entry.

I did not have any issue with this way, but I'm open to suggestions if you can think of a better way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants