Handle WithUser to get one tag
MODIFY
src/assets/server/rest/v1/schemas/tag/tag-get.json
src/assets/server/rest/v1/schemas/tag/tag-get.json
"ID": {
"$ref": "tag.json#/definitions/id"
},
+ "WithUser": {
+ "type": "boolean",
+ "sanitize": "mongo"
+ },
"ProjectFields": {
"$ref": "common.json#/definitions/projectFields"
}

MODIFY
src/server/rest/v1/service/TagService.ts
src/server/rest/v1/service/TagService.ts
@@ -46,7 +46,7 @@ export default class TagService {
const filteredRequest = TagValidator.getInstance().validateTagGetByID(req.query);
// Check and Get Tag
const tag = await UtilsService.checkAndGetTagAuthorization(
- req.tenant, req.user, filteredRequest.ID, Action.READ, action, null, { withUser: true }, true);
+ req.tenant, req.user, filteredRequest.ID, Action.READ, action, null, { withUser: filteredRequest.WithUser }, true);
res.json(tag);
next();
}

MODIFY
src/types/requests/HttpTagRequest.ts
src/types/requests/HttpTagRequest.ts
@@ -3,6 +3,7 @@ import HttpDatabaseRequest from './HttpDatabaseRequest';
export interface HttpTagRequest extends HttpByIDRequest {
ID: string;
+ WithUser: boolean;
}
export interface HttpTagsRequest extends HttpDatabaseRequest {

Handle WithUser to get one tag