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
- total parameter not working correctly in...
Hello Appwrite team, I'm experiencing issues with the total parameter in the listRows() method (TablesDB) across multiple SDKs. **Issue 1**: Node.js SDK (node...
- Free plan Usage
I using a free plan with one organization. I have three projects but on the free plan I should be able to have 2 projects running But in my case only 1 out of ...
- Database AI Column Suggestion Use Case
I tried using the AI column suggestion feature. For me, I prefer writing my column design separately in a notepad. Then my intention is to paste it into the AI ...