Closed Alys closed 4 years ago
Is this issue still looking for help? Seems like a good issue that I could start with.
If I am not mistaken, a straightforward fix would probably be to use the $ne operator to exclude the entry with the tavern ID.
@AlexanderColen it's still looking for help!
These two methods are the ones most commonly used to fetch one or more groups https://github.com/HabitRPG/habitica/blob/develop/website/server/models/group.js#L230-L363
If you use the api/v3/groups route to get a list of guilds for a user, then the returned list includes the Tavern. The Tavern should not be included.
I.e., if you do this command:
curl -s -X GET -H "x-api-user: $HRPG_USER_USERID" -H "x-api-key: $HRPG_USER_APITOKEN" https://habitica.com/api/v3/groups"?type=publicGuilds&paginate=false"
then the returned list includes all appropriate guilds but also this entry:{"_id":"00000000-0000-4000-A000-000000000000","privacy":"public","memberCount":7577,"balance":0,"leader":"7bde7864-ebc5-4ee2-a4b7-1070d464cdb0","name":"Tavern","type":"guild","categories":[]}
That entry represents the Tavern and it's included in the data from that route because from a technical perspective the Tavern is stored as a guild (however from a user's perspective it's not a guild).
The desired fix is that the api/v3/groups GET route should have an exception coded into it to prevent the group with the ID "00000000-0000-4000-A000-000000000000" from being included.
Note that that group ID is available as a constant: https://github.com/HabitRPG/habitica/blob/fef9c74f9b9ab9b49ae4a8f9380faa7007fb5535/website/common/script/constants.js#L7
This issue was created from https://github.com/HabitRPG/habitica/issues/7431