tomaspavlin / clubhouse-client

User-friendly web client for Clubhouse - drop-in audio chat. Written in React.
MIT License
34 stars 4 forks source link

Question on Followers and Following #6

Closed togacaptain closed 3 years ago

togacaptain commented 3 years ago

First off great job adapting this to work in a web client. I was able to get everything working and wanted to try to extend it to support getting User Followers and Followed Users. I added the request to the index. But neither one are working. Followers returns with an empty response and Following crashes. I looked at the base library and it looks like it is expecting an object of

{"user_id": 1234}

But that didn't seem to work either. Have you tried to get this option working? Any suggestions?

UPDATE: Got getFollowers to work using the below code. Still not working with getFollowing

router.get('/followers/:id', async (req, res, next) => { const json = await req.clubhouse.getFollowers(parseInt(req.params.id)) res.json(json); });

UPDATE 2: Got getFollowing working as well. The request was basically the same, but there was a second problem. I also had to bump the clubhouse-api version to 1.0.19 to include the latest updates (which fixed a typo in getFollowing).

router.get('/following/:id', async (req, res, next) => { const json = await req.clubhouse.getFollowing(parseInt(req.params.id)) res.json(json); });