
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
- 2 Columns still processing since yesterd...
Hey o/ Yesterday (around <t:1758045600:f>), I created a database and added several columns to it. After about 15 minutes, most of the "processing" tags disappe...
- 503 Timeout when Updating or Upserting D...
Hey I’m running into an issue when trying to update or upsert a row in Appwrite. The request hangs for a while and then throws this error: ``` AppwriteException...
- Row with the requested ID already exists...
I’m hitting a blocking issue creating rows in Appwrite (both from the console and my React Native app). After successfully inserting the first row, every subseq...
