Hi, I'm creating the following and follower function for users. What's the best way to do it in Appwrite? I'm using the Follower and Following as attributes in Users document. When I try to update user following with this code, I got the respond status error 500. Please help me with the issue. Thank you!
Summary
The developer is having trouble implementing a follower and following function in their social media app using Appwrite. They are experiencing a 500 error when trying to update a user's following attribute. The developer is looking for assistance with resolving this issue.
Solution: Check if the user collection exists and if the id matches the user id. Ensure that the array of followers is properly formatted as an array of strings in the code.
Kenny
Jan 12, 2024, 17:27
What is the 500 error message?
Do you have a collection for users and the id of that collection is the user id?
🆃🅾🅳🅰🅼🅾🅾🅽 🏄🌊
Web Developer
Jan 12, 2024, 17:44
The message is general_unknown,the id of the collection is userCollectionId, which is store in the .env and the document id is the user.userId
Kenny
Jan 12, 2024, 17:46
Sorry, I meant the document id.
What does your array look like? Is it just an array of strings?
🆃🅾🅳🅰🅼🅾🅾🅽 🏄🌊
Web Developer
Jan 12, 2024, 17:46
This is console.log("user in saveFollower: ", user, followingArray)