Back

Follower and Following for Social Media App

  • 0
  • Users
  • Databases
  • Web
πŸ†ƒπŸ…ΎπŸ…³πŸ…°πŸ…ΌπŸ…ΎπŸ…ΎπŸ…½ πŸ„πŸŒŠ
12 Jan, 2024, 17:11

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!

TL;DR
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
12 Jan, 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?

πŸ†ƒπŸ…ΎπŸ…³πŸ…°πŸ…ΌπŸ…ΎπŸ…ΎπŸ…½ πŸ„πŸŒŠ
12 Jan, 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
12 Jan, 2024, 17:46

Sorry, I meant the document id.

What does your array look like? Is it just an array of strings?

πŸ†ƒπŸ…ΎπŸ…³πŸ…°πŸ…ΌπŸ…ΎπŸ…ΎπŸ…½ πŸ„πŸŒŠ
12 Jan, 2024, 17:46

This is console.log("user in saveFollower: ", user, followingArray)

πŸ†ƒπŸ…ΎπŸ…³πŸ…°πŸ…ΌπŸ…ΎπŸ…ΎπŸ…½ πŸ„πŸŒŠ
12 Jan, 2024, 17:47

Yeah, it's the array of strings

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more