mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 05:37:22 +01:00
Remove Tavern from API v3 list of guilds when 'guild' or 'publicGuilds' type parameter get added. (Fixes #12407) (#12438)
* Excluding tavern from showing up in GET /groups API when 'guilds' or 'publicGuilds' type parameter is included. * Fixed test errors. * Resolved pull request #12438 issues. Moved Tavern exclusion to Group model, removed Group controller back to the original and resolved test failures.
This commit is contained in:
@@ -301,7 +301,7 @@ schema.statics.getGroups = async function getGroups (options = {}) {
|
||||
case 'guilds': {
|
||||
const query = {
|
||||
type: 'guild',
|
||||
_id: { $in: user.guilds },
|
||||
_id: { $in: user.guilds, $ne: TAVERN_ID },
|
||||
};
|
||||
_.assign(query, filters);
|
||||
const userGuildsQuery = this.find(query).select(groupFields);
|
||||
@@ -330,6 +330,7 @@ schema.statics.getGroups = async function getGroups (options = {}) {
|
||||
const query = {
|
||||
type: 'guild',
|
||||
privacy: 'public',
|
||||
_id: { $ne: TAVERN_ID },
|
||||
};
|
||||
_.assign(query, filters);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user