mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-21 23:12:58 +01:00
feat: send flags count to frontend on flags list page
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
"reports": "Reports",
|
||||
"first-reported": "First Reported",
|
||||
"no-flags": "Hooray! No flags found.",
|
||||
"x-flags-found": "%1 flag(s) found.",
|
||||
"assignee": "Assignee",
|
||||
"update": "Update",
|
||||
"updated": "Updated",
|
||||
|
||||
@@ -97,6 +97,7 @@ modsController.flags.list = async function (req, res) {
|
||||
|
||||
res.render('flags/list', {
|
||||
flags: flagsData.flags,
|
||||
count: flagsData.count,
|
||||
analytics: analyticsData,
|
||||
selectedCategory: selectData.selectedCategory,
|
||||
hasFilter: hasFilter,
|
||||
|
||||
@@ -191,6 +191,7 @@ Flags.list = async function (data) {
|
||||
query: data.query,
|
||||
});
|
||||
flagIds = await Flags.sort(flagIds, data.sort);
|
||||
const count = flagIds.length;
|
||||
|
||||
// Create subset for parsing based on page number (n=20)
|
||||
const flagsPerPage = Math.abs(parseInt(filters.perPage, 10) || 1);
|
||||
@@ -223,6 +224,7 @@ Flags.list = async function (data) {
|
||||
|
||||
return {
|
||||
flags: payload.flags,
|
||||
count,
|
||||
page: payload.page,
|
||||
pageCount: pageCount,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user