Hi, I'm trying to get at least a simple confirmation message that the query is working, but it seems that something is off with permissions, even thought I've set the collection permissions to Any in my Appwrite database collection console. The error I get is : "AppwriteException: user_unauthorized, The current user is not authorized to perform the requested action. (401)"
If the query returns nothing, it correctly prints "Match not found", but if it does, it just throws that exception. What am I doing wrong?
Thank you
final TextEditingController _searchController = TextEditingController(); final databases = Databases(Appwrite.instance.client); List<Document> searchResults = []; String searchMessage = '';
Future<void> searchCareer(String query) async { try { final documents = await databases.listDocuments( databaseId: constants.appwriteDatabaseId, collectionId: constants.appwriteCollectionId, queries: [ Query.equal("career_name", query) ], );
setState(() {
searchResults = documents.documents;
searchMessage = searchResults.isNotEmpty ? 'Found match' : 'Match not found';
});
} on AppwriteException catch (e) {
print(e);
}
}
Recommended threads
- New attribute stuck on processing?
I was running out of disk space and after creating an attribute and restarting my appwrite (self hosted) I have an attribute stuck on creation. Any way to remov...
- CORS error only on tables db api After u...
I've recently updated my self hosted appwrite instance to the 1.8.0 and updated my frontend with the tables db apis but strangely, even if I'm able to log in, g...
- Bug: When creating a table, table name i...
I created a table with a typo. my_taable .... then my code couldn't find it. i updated table name and still couldn't find it. the table name doesn't update. i h...