| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835 |
- import loggerFactory from '~/utils/logger';
- import { excludeTestIdsFromTargetIds } from '~/server/util/compare-objectId';
- import UserGroup from '~/server/models/user-group';
- import { apiV3FormValidator } from '../../middlewares/apiv3-form-validator';
- const logger = loggerFactory('growi:routes:apiv3:user-group'); // eslint-disable-line no-unused-vars
- const express = require('express');
- const router = express.Router();
- const { body, param, query } = require('express-validator');
- const { sanitizeQuery } = require('express-validator');
- const mongoose = require('mongoose');
- const ErrorV3 = require('../../models/vo/error-apiv3');
- const { serializeUserSecurely } = require('../../models/serializers/user-serializer');
- const { toPagingLimit, toPagingOffset } = require('../../util/express-validator/sanitizer');
- const { ObjectId } = mongoose.Types;
- /**
- * @swagger
- * tags:
- * name: UserGroup
- */
- module.exports = (crowi) => {
- const loginRequiredStrictly = require('../../middlewares/login-required')(crowi);
- const adminRequired = require('../../middlewares/admin-required')(crowi);
- const csrf = require('../../middlewares/csrf')(crowi);
- const {
- UserGroupRelation,
- User,
- Page,
- } = crowi.models;
- const validator = {
- create: [
- body('name', 'Group name is required').trim().exists({ checkFalsy: true }),
- body('description', 'Description must be a string').optional().isString(),
- body('parentId', 'ParentId must be a string').optional().isString(),
- ],
- update: [
- body('name', 'Group name is required').trim().exists({ checkFalsy: true }),
- body('description', 'Group description must be a string').optional().isString(),
- body('parentId', 'parentId must be a string').optional().isString(),
- body('forceUpdateParents', 'forceUpdateParents must be a boolean').optional().isBoolean(),
- ],
- delete: [
- param('id').trim().exists({ checkFalsy: true }),
- query('actionName').trim().exists({ checkFalsy: true }),
- query('transferToUserGroupId').trim(),
- ],
- listChildren: [
- query('parentIds', 'parentIds must be an array').optional().isArray(),
- query('includeGrandChildren', 'parentIds must be boolean').optional().isBoolean(),
- ],
- ancestorGroup: [
- query('groupId', 'groupId must be a string').optional().isString(),
- ],
- selectableGroups: [
- query('groupId', 'groupId must be a string').optional().isString(),
- ],
- users: {
- post: [
- param('id').trim().exists({ checkFalsy: true }),
- param('username').trim().exists({ checkFalsy: true }),
- ],
- delete: [
- param('id').trim().exists({ checkFalsy: true }),
- param('username').trim().exists({ checkFalsy: true }),
- ],
- },
- pages: {
- get: [
- param('id').trim().exists({ checkFalsy: true }),
- sanitizeQuery('limit').customSanitizer(toPagingLimit),
- sanitizeQuery('offset').customSanitizer(toPagingOffset),
- ],
- },
- };
- /**
- * @swagger
- *
- * paths:
- * /user-groups:
- * get:
- * tags: [UserGroup]
- * operationId: getUserGroup
- * summary: /user-groups
- * description: Get usergroups
- * responses:
- * 200:
- * description: usergroups are fetched
- * content:
- * application/json:
- * schema:
- * properties:
- * userGroups:
- * type: object
- * description: a result of `UserGroup.find`
- */
- router.get('/', loginRequiredStrictly, adminRequired, async(req, res) => { // TODO 85062: userGroups with no parent
- const { query } = req;
- // TODO 85062: improve sort
- try {
- const page = query.page != null ? parseInt(query.page) : undefined;
- const limit = query.limit != null ? parseInt(query.limit) : undefined;
- const offset = query.offset != null ? parseInt(query.offset) : undefined;
- const pagination = query.pagination != null ? query.pagination !== 'false' : undefined;
- const result = await UserGroup.findUserGroupsWithPagination({
- page, limit, offset, pagination,
- });
- const { docs: userGroups, totalDocs: totalUserGroups, limit: pagingLimit } = result;
- return res.apiv3({ userGroups, totalUserGroups, pagingLimit });
- }
- catch (err) {
- const msg = 'Error occurred in fetching user group list';
- logger.error('Error', err);
- return res.apiv3Err(new ErrorV3(msg, 'user-group-list-fetch-failed'));
- }
- });
- /**
- * @swagger
- *
- * paths:
- * /ancestors:
- * get:
- * tags: [UserGroup]
- * operationId: getAncestorUserGroups
- * summary: /ancestors
- * description: Get ancestor user groups.
- * parameters:
- * - name: groupId
- * in: query
- * required: true
- * description: id of userGroup
- * schema:
- * type: string
- * responses:
- * 200:
- * description: userGroups are fetched
- * content:
- * application/json:
- * schema:
- * properties:
- * userGroups:
- * type: array
- * items:
- * type: object
- * description: userGroup objects
- */
- router.get('/ancestors', loginRequiredStrictly, adminRequired, validator.ancestorGroup, async(req, res) => {
- const { groupId } = req.query;
- try {
- const userGroup = await UserGroup.findById(groupId);
- const ancestorUserGroups = await UserGroup.findGroupsWithAncestorsRecursively(userGroup);
- return res.apiv3({ ancestorUserGroups });
- }
- catch (err) {
- const msg = 'Error occurred while searching user groups';
- logger.error(msg, err);
- return res.apiv3Err(new ErrorV3(msg, 'user-groups-search-failed'));
- }
- });
- // TODO 85062: improve sort
- router.get('/children', loginRequiredStrictly, adminRequired, validator.listChildren, async(req, res) => {
- try {
- const { parentIds, includeGrandChildren = false } = req.query;
- const userGroupsResult = await UserGroup.findChildUserGroupsByParentIds(parentIds, includeGrandChildren);
- return res.apiv3({
- childUserGroups: userGroupsResult.childUserGroups,
- grandChildUserGroups: userGroupsResult.grandChildUserGroups,
- });
- }
- catch (err) {
- const msg = 'Error occurred in fetching child user group list';
- logger.error(msg, err);
- return res.apiv3Err(new ErrorV3(msg, 'child-user-group-list-fetch-failed'));
- }
- });
- /**
- * @swagger
- *
- * paths:
- * /user-groups:
- * post:
- * tags: [UserGroup]
- * operationId: createUserGroup
- * summary: /user-groups
- * description: Adds userGroup
- * requestBody:
- * required: true
- * content:
- * application/json:
- * schema:
- * properties:
- * name:
- * type: string
- * description: name of the userGroup trying to be added
- * responses:
- * 200:
- * description: userGroup is added
- * content:
- * application/json:
- * schema:
- * properties:
- * userGroup:
- * type: object
- * description: A result of `UserGroup.createGroupByName`
- */
- router.post('/', loginRequiredStrictly, adminRequired, csrf, validator.create, apiV3FormValidator, async(req, res) => {
- const { name, description = '', parentId } = req.body;
- try {
- const userGroupName = crowi.xss.process(name);
- const userGroupDescription = crowi.xss.process(description);
- const userGroup = await UserGroup.createGroup(userGroupName, userGroupDescription, parentId);
- return res.apiv3({ userGroup }, 201);
- }
- catch (err) {
- const msg = 'Error occurred in creating a user group';
- logger.error(msg, err);
- return res.apiv3Err(new ErrorV3(msg, 'user-group-create-failed'));
- }
- });
- /**
- * @swagger
- *
- * paths:
- * /selectable-parent-groups:
- * get:
- * tags: [UserGroup]
- * operationId: getSelectableParentGroups
- * summary: /selectable-parent-groups
- * description: Get selectable parent UserGroups
- * parameters:
- * - name: groupId
- * in: query
- * required: true
- * description: id of userGroup
- * schema:
- * type: string
- * responses:
- * 200:
- * description: userGroups are fetched
- * content:
- * application/json:
- * schema:
- * properties:
- * userGroups:
- * type: array
- * items:
- * type: object
- * description: userGroup objects
- */
- router.get('/selectable-parent-groups', loginRequiredStrictly, adminRequired, validator.selectableGroups, async(req, res) => {
- const { groupId } = req.query;
- try {
- const userGroup = await UserGroup.findById(groupId);
- const descendantGroups = await UserGroup.findGroupsWithDescendantsRecursively([userGroup], []);
- const descendantGroupIds = descendantGroups.map(userGroups => userGroups._id.toString());
- const selectableParentGroups = await UserGroup.find({ _id: { $nin: [groupId, ...descendantGroupIds] } });
- return res.apiv3({ selectableParentGroups });
- }
- catch (err) {
- const msg = 'Error occurred while searching user groups';
- logger.error(msg, err);
- return res.apiv3Err(new ErrorV3(msg, 'user-groups-search-failed'));
- }
- });
- /**
- * @swagger
- *
- * paths:
- * /selectable-child-groups:
- * get:
- * tags: [UserGroup]
- * operationId: getSelectableChildGroups
- * summary: /selectable-child-groups
- * description: Get selectable child UserGroups
- * parameters:
- * - name: groupId
- * in: query
- * required: true
- * description: id of userGroup
- * schema:
- * type: string
- * responses:
- * 200:
- * description: userGroups are fetched
- * content:
- * application/json:
- * schema:
- * properties:
- * userGroups:
- * type: array
- * items:
- * type: object
- * description: userGroup objects
- */
- router.get('/selectable-child-groups', loginRequiredStrictly, adminRequired, validator.selectableGroups, async(req, res) => {
- const { groupId } = req.query;
- try {
- const userGroup = await UserGroup.findById(groupId);
- const [ancestorGroups, descendantGroups] = await Promise.all([
- UserGroup.findGroupsWithAncestorsRecursively(userGroup, []),
- UserGroup.findGroupsWithDescendantsRecursively([userGroup], []),
- ]);
- const excludeUserGroupIds = [userGroup, ...ancestorGroups, ...descendantGroups].map(userGroups => userGroups._id.toString());
- const selectableChildGroups = await UserGroup.find({ _id: { $nin: excludeUserGroupIds } });
- return res.apiv3({ selectableChildGroups });
- }
- catch (err) {
- const msg = 'Error occurred while searching user groups';
- logger.error(msg, err);
- return res.apiv3Err(new ErrorV3(msg, 'user-groups-search-failed'));
- }
- });
- /**
- * @swagger
- *
- * paths:
- * /user-groups/{id}:
- * get:
- * tags: [UserGroup]
- * operationId: getUserGroupFromGroupId
- * summary: /user-groups/{id}
- * description: Get UserGroup from Group ID
- * parameters:
- * - name: id
- * in: path
- * required: true
- * description: id of userGroup
- * schema:
- * type: string
- * responses:
- * 200:
- * description: userGroup are fetched
- * content:
- * application/json:
- * schema:
- * properties:
- * userGroup:
- * type: object
- * description: userGroup object
- */
- router.get('/:id', loginRequiredStrictly, adminRequired, validator.selectableGroups, async(req, res) => {
- const { id: groupId } = req.params;
- try {
- const userGroup = await UserGroup.findById(groupId);
- return res.apiv3({ userGroup });
- }
- catch (err) {
- const msg = 'Error occurred while getting user group';
- logger.error(msg, err);
- return res.apiv3Err(new ErrorV3(msg, 'user-groups-get-failed'));
- }
- });
- /**
- * @swagger
- *
- * paths:
- * /user-groups/{id}:
- * delete:
- * tags: [UserGroup]
- * operationId: deleteUserGroup
- * summary: /user-groups/{id}
- * description: Deletes userGroup
- * parameters:
- * - name: id
- * in: path
- * required: true
- * description: id of userGroup
- * schema:
- * type: string
- * - name: actionName
- * in: query
- * description: name of action
- * schema:
- * type: string
- * - name: transferToUserGroupId
- * in: query
- * description: userGroup id that will be transferred to
- * schema:
- * type: string
- * responses:
- * 200:
- * description: userGroup is removed
- * content:
- * application/json:
- * schema:
- * properties:
- * userGroups:
- * type: object
- * description: A result of `UserGroup.removeCompletelyById`
- */
- router.delete('/:id', loginRequiredStrictly, adminRequired, csrf, validator.delete, apiV3FormValidator, async(req, res) => {
- const { id: deleteGroupId } = req.params;
- const { actionName, transferToUserGroupId } = req.query;
- try {
- const userGroups = await crowi.userGroupService.removeCompletelyByRootGroupId(deleteGroupId, actionName, transferToUserGroupId, req.user);
- return res.apiv3({ userGroups });
- }
- catch (err) {
- const msg = 'Error occurred while deleting user groups';
- logger.error(msg, err);
- return res.apiv3Err(new ErrorV3(msg, 'user-groups-delete-failed'));
- }
- });
- /**
- * @swagger
- *
- * paths:
- * /user-groups/{id}:
- * put:
- * tags: [UserGroup]
- * operationId: updateUserGroups
- * summary: /user-groups/{id}
- * description: Update userGroup
- * parameters:
- * - name: id
- * in: path
- * required: true
- * description: id of userGroup
- * schema:
- * type: string
- * responses:
- * 200:
- * description: userGroup is updated
- * content:
- * application/json:
- * schema:
- * properties:
- * userGroup:
- * type: object
- * description: A result of `UserGroup.updateName`
- */
- router.put('/:id', loginRequiredStrictly, adminRequired, csrf, validator.update, apiV3FormValidator, async(req, res) => {
- const { id } = req.params;
- const {
- name, description, parentId, forceUpdateParents = false,
- } = req.body;
- try {
- const userGroup = await crowi.userGroupService.updateGroup(id, name, description, parentId, forceUpdateParents);
- return res.apiv3({ userGroup });
- }
- catch (err) {
- const msg = 'Error occurred in updating a user group name';
- logger.error(msg, err);
- return res.apiv3Err(new ErrorV3(msg, 'user-group-update-failed'));
- }
- });
- /**
- * @swagger
- *
- * paths:
- * /user-groups/{id}/users:
- * get:
- * tags: [UserGroup]
- * operationId: getUsersUserGroups
- * summary: /user-groups/{id}/users
- * description: Get users related to the userGroup
- * parameters:
- * - name: id
- * in: path
- * required: true
- * description: id of userGroup
- * schema:
- * type: string
- * responses:
- * 200:
- * description: users are fetched
- * content:
- * application/json:
- * schema:
- * properties:
- * users:
- * type: array
- * items:
- * type: object
- * description: user objects
- */
- router.get('/:id/users', loginRequiredStrictly, adminRequired, async(req, res) => {
- const { id } = req.params;
- try {
- const userGroup = await UserGroup.findById(id);
- const userGroupRelations = await UserGroupRelation.findAllRelationForUserGroup(userGroup);
- const serializeUsers = userGroupRelations.map((userGroupRelation) => {
- return serializeUserSecurely(userGroupRelation.relatedUser);
- });
- const users = serializeUsers.filter(user => user != null);
- return res.apiv3({ users });
- }
- catch (err) {
- const msg = `Error occurred in fetching users for group: ${id}`;
- logger.error(msg, err);
- return res.apiv3Err(new ErrorV3(msg, 'user-group-user-list-fetch-failed'));
- }
- });
- /**
- * @swagger
- *
- * paths:
- * /user-groups/{id}/unrelated-users:
- * get:
- * tags: [UserGroup]
- * operationId: getUnrelatedUsersUserGroups
- * summary: /user-groups/{id}/unrelated-users
- * description: Get users unrelated to the userGroup
- * parameters:
- * - name: id
- * in: path
- * required: true
- * description: id of userGroup
- * schema:
- * type: string
- * responses:
- * 200:
- * description: users are fetched
- * content:
- * application/json:
- * schema:
- * properties:
- * users:
- * type: array
- * items:
- * type: object
- * description: user objects
- */
- router.get('/:id/unrelated-users', loginRequiredStrictly, adminRequired, async(req, res) => {
- const { id } = req.params;
- const {
- searchWord, searchType, isAlsoNameSearched, isAlsoMailSearched,
- } = req.query;
- const queryOptions = {
- searchWord, searchType, isAlsoNameSearched, isAlsoMailSearched,
- };
- try {
- const userGroup = await UserGroup.findById(id);
- const users = await UserGroupRelation.findUserByNotRelatedGroup(userGroup, queryOptions);
- // return email only this api
- const serializedUsers = users.map((user) => {
- const { email } = user;
- const serializedUser = serializeUserSecurely(user);
- serializedUser.email = email;
- return serializedUser;
- });
- return res.apiv3({ users: serializedUsers });
- }
- catch (err) {
- const msg = `Error occurred in fetching unrelated users for group: ${id}`;
- logger.error(msg, err);
- return res.apiv3Err(new ErrorV3(msg, 'user-group-unrelated-user-list-fetch-failed'));
- }
- });
- /**
- * @swagger
- *
- * paths:
- * /user-groups/{id}/users:
- * post:
- * tags: [UserGroup]
- * operationId: addUserUserGroups
- * summary: /user-groups/{id}/users
- * description: Add a user to the userGroup
- * parameters:
- * - name: id
- * in: path
- * required: true
- * description: id of userGroup
- * schema:
- * type: string
- * responses:
- * 200:
- * description: a user is added
- * content:
- * application/json:
- * schema:
- * type: object
- * properties:
- * user:
- * type: object
- * description: the user added to the group
- * userGroup:
- * type: object
- * description: the group to which a user was added
- * userGroupRelation:
- * type: object
- * description: the associative entity between user and userGroup
- */
- router.post('/:id/users/:username', loginRequiredStrictly, adminRequired, validator.users.post, apiV3FormValidator, async(req, res) => {
- const { id, username } = req.params;
- try {
- const [userGroup, user] = await Promise.all([
- UserGroup.findById(id),
- User.findUserByUsername(username),
- ]);
- const userGroups = await UserGroup.findGroupsWithAncestorsRecursively(userGroup);
- const userGroupIds = userGroups.map(g => g._id);
- // check for duplicate users in groups
- const existingRelations = await UserGroupRelation.find({ relatedGroup: { $in: userGroupIds }, relatedUser: user._id });
- const existingGroupIds = existingRelations.map(r => r.relatedGroup);
- const groupIdsOfRelationToCreate = excludeTestIdsFromTargetIds(userGroupIds, existingGroupIds);
- const insertedRelations = await UserGroupRelation.createRelations(groupIdsOfRelationToCreate, user);
- const serializedUser = serializeUserSecurely(user);
- return res.apiv3({ user: serializedUser, createdRelationCount: insertedRelations.length });
- }
- catch (err) {
- const msg = `Error occurred in adding the user "${username}" to group "${id}"`;
- logger.error(msg, err);
- return res.apiv3Err(new ErrorV3(msg, 'user-group-add-user-failed'));
- }
- });
- /**
- * @swagger
- *
- * paths:
- * /user-groups/{id}/users:
- * delete:
- * tags: [UserGroup]
- * operationId: deleteUsersUserGroups
- * summary: /user-groups/{id}/users
- * description: remove a user from the userGroup
- * parameters:
- * - name: id
- * in: path
- * required: true
- * description: id of userGroup
- * schema:
- * type: string
- * responses:
- * 200:
- * description: a user was removed
- * content:
- * application/json:
- * schema:
- * type: object
- * properties:
- * user:
- * type: object
- * description: the user removed from the group
- * userGroup:
- * type: object
- * description: the group from which a user was removed
- * userGroupRelation:
- * type: object
- * description: the associative entity between user and userGroup
- */
- router.delete('/:id/users/:username', loginRequiredStrictly, adminRequired, validator.users.delete, apiV3FormValidator, async(req, res) => {
- const { id, username } = req.params;
- try {
- const [userGroup, user] = await Promise.all([
- UserGroup.findById(id),
- User.findUserByUsername(username),
- ]);
- const groupsOfRelationsToDelete = await UserGroup.findGroupsWithDescendantsRecursively([userGroup]);
- const relatedGroupIdsToDelete = groupsOfRelationsToDelete.map(g => g._id);
- const deleteManyRes = await UserGroupRelation.deleteMany({ relatedUser: user._id, relatedGroup: { $in: relatedGroupIdsToDelete } });
- const serializedUser = serializeUserSecurely(user);
- return res.apiv3({ user: serializedUser, deletedGroupsCount: deleteManyRes.deletedCount });
- }
- catch (err) {
- const msg = 'Error occurred while removing the user from groups.';
- logger.error(msg, err);
- return res.apiv3Err(new ErrorV3(msg, 'user-group-remove-user-failed'));
- }
- });
- /**
- * @swagger
- *
- * paths:
- * /user-groups/{id}/user-group-relations:
- * get:
- * tags: [UserGroup]
- * operationId: getUserGroupRelationsUserGroups
- * summary: /user-groups/{id}/user-group-relations
- * description: Get the user group relations for the userGroup
- * parameters:
- * - name: id
- * in: path
- * required: true
- * description: id of userGroup
- * schema:
- * type: string
- * responses:
- * 200:
- * description: user group relations are fetched
- * content:
- * application/json:
- * schema:
- * properties:
- * userGroupRelations:
- * type: array
- * items:
- * type: object
- * description: userGroupRelation objects
- */
- router.get('/:id/user-group-relations', loginRequiredStrictly, adminRequired, async(req, res) => {
- const { id } = req.params;
- try {
- const userGroup = await UserGroup.findById(id);
- const userGroupRelations = await UserGroupRelation.findAllRelationForUserGroup(userGroup);
- return res.apiv3({ userGroupRelations });
- }
- catch (err) {
- const msg = `Error occurred in fetching user group relations for group: ${id}`;
- logger.error(msg, err);
- return res.apiv3Err(new ErrorV3(msg, 'user-group-user-group-relation-list-fetch-failed'));
- }
- });
- /**
- * @swagger
- *
- * paths:
- * /user-groups/{id}/pages:
- * get:
- * tags: [UserGroup]
- * operationId: getPagesUserGroups
- * summary: /user-groups/{id}/pages
- * description: Get closed pages for the userGroup
- * parameters:
- * - name: id
- * in: path
- * required: true
- * description: id of userGroup
- * schema:
- * type: string
- * responses:
- * 200:
- * description: pages are fetched
- * content:
- * application/json:
- * schema:
- * properties:
- * pages:
- * type: array
- * items:
- * type: object
- * description: page objects
- */
- router.get('/:id/pages', loginRequiredStrictly, adminRequired, validator.pages.get, apiV3FormValidator, async(req, res) => {
- const { id } = req.params;
- const { limit, offset } = req.query;
- try {
- const { docs, totalDocs } = await Page.paginate({
- grant: Page.GRANT_USER_GROUP,
- grantedGroup: { $in: [id] },
- }, {
- offset,
- limit,
- populate: 'lastUpdateUser',
- });
- const current = offset / limit + 1;
- const pages = docs.map((doc) => {
- doc.lastUpdateUser = serializeUserSecurely(doc.lastUpdateUser);
- return doc;
- });
- // TODO: create a common moudule for paginated response
- return res.apiv3({ total: totalDocs, current, pages });
- }
- catch (err) {
- const msg = `Error occurred in fetching pages for group: ${id}`;
- logger.error(msg, err);
- return res.apiv3Err(new ErrorV3(msg, 'user-group-page-list-fetch-failed'));
- }
- });
- return router;
- };
|