Skip to content

Commit

Permalink
fix: remove 'filters' and 'categories' from flag details API return […
Browse files Browse the repository at this point in the history
…breaking]

These options were originally used when the flag filters were shown in the sidebar. This has seen been removed, and so the information is now superfluous
  • Loading branch information
julianlam committed Jan 25, 2021
1 parent 1603566 commit 8b72479
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
11 changes: 0 additions & 11 deletions public/openapi/read/flags/flagId.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,6 @@ get:
type: boolean
title:
type: string
categories:
type: object
additionalProperties:
type: string
filters:
type: object
properties:
page:
type: number
perPage:
type: number
privileges:
type: object
properties: {}
Expand Down
9 changes: 0 additions & 9 deletions src/controllers/mods.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ modsController.flags.detail = async function (req, res, next) {
moderatedCids: user.getModeratedCids(req.uid),
flagData: flags.get(req.params.flagId),
assignees: user.getAdminsandGlobalModsandModerators(),
categories: categories.buildForSelect(req.uid, 'read'),
privileges: Promise.all(['global', 'admin'].map(async type => privileges[type].get(req.uid))),
});
results.privileges = { ...results.privileges[0], ...results.privileges[1] };
Expand All @@ -145,12 +144,6 @@ modsController.flags.detail = async function (req, res, next) {
return next(new Error('[[error:no-privileges]]'));
}

if (!results.isAdminOrGlobalMod && results.moderatedCids.length) {
res.locals.cids = results.moderatedCids;
}

results.categories = filterCategories(res.locals.cids, results.categories);

if (results.flagData.type === 'user') {
results.flagData.type_path = 'uid';
} else if (results.flagData.type === 'post') {
Expand All @@ -169,8 +162,6 @@ modsController.flags.detail = async function (req, res, next) {
return memo;
}, {}),
title: '[[pages:flag-details, ' + req.params.flagId + ']]',
categories: results.categories,
filters: req.session.flags_filters || {},
privileges: results.privileges,
breadcrumbs: helpers.buildBreadcrumbs([
{ text: '[[pages:flags]]', url: '/flags' },
Expand Down

0 comments on commit 8b72479

Please sign in to comment.