So I am building a project management web app with react and next js and using appwrite as my backend. I am getting an error in uploading comment to this database. I have put all the auth functionalities into a context hook so that I can extract them whenever I want to use them. Here is the auth context function, I use a custom hook for later usage.
I use a state variable to track the session and the current logged in users credentials. Later I extract it in other components so that I can get the user ID. I can get the user ID in the console but for some reason when I extract it in the code and pass it on as a schema to the DB it gives an error that the user ID is missing. Here are the images of the error and user ID in my code.
Now here is some more code. I also use a context hook based approach to pass on the functionalities of a database to child components whenever they need to. Then I extract the funcitionality and then try to pass it to the database like the code img given below.
Now here are some screenshots of the networks tab and the pattern of the collections in the DB.
I know this is a very long question but I have been dealing with this for the last two months, I even changed my tech stack because of this dumb error and it still does not go away
Recommended threads
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...
- What Query's are valid for GetDocument?
Documentation shows that Queries are valid here, but doesn't explain which queries are valid. At first I presumed this to be a bug, but before creating a githu...
- Appwrite exception: user_unauthorized, t...
After refreshing the app it is working perfectly