diff --git a/src/controllers/v1/entities.js b/src/controllers/v1/entities.js index fd0736e..3c00350 100644 --- a/src/controllers/v1/entities.js +++ b/src/controllers/v1/entities.js @@ -762,14 +762,8 @@ module.exports = class Entities extends Abstract { let pointerToEntitiesArray = 0; pointerToEntitiesArray < entityDocuments.result.data.length; pointerToEntitiesArray++ - ) { - if (entityDocuments.result.data[pointerToEntitiesArray].entityType == 'school') { - entityDocuments.result.data[pointerToEntitiesArray].label += - ' - ' + entityDocuments.result.data[pointerToEntitiesArray].externalId - } - } + ) {} } - return resolve(entityDocuments) } catch (error) { return reject({ diff --git a/src/generics/constants/api-responses.js b/src/generics/constants/api-responses.js index 3e7994e..4d9c9b9 100644 --- a/src/generics/constants/api-responses.js +++ b/src/generics/constants/api-responses.js @@ -55,5 +55,5 @@ module.exports = { USER_ROLE_INFORMATION_CREATED: 'USER_ROLE_INFORMATION_CREATED', USER_ROLE_UPDATATED: 'USER_ROLE_UPDATATED', USER_ROLE_DELETED: 'USER_ROLE_DELETED', - ENTITY_UPDATATED:'ENTITY_UPDATATED' + ENTITY_UPDATED: 'ENTITY_UPDATED', } diff --git a/src/module/entities/helper.js b/src/module/entities/helper.js index bea8035..0f42a69 100644 --- a/src/module/entities/helper.js +++ b/src/module/entities/helper.js @@ -1454,7 +1454,7 @@ module.exports = class UserProjectsHelper { } resolve({ success: true, - message: CONSTANTS.apiResponses.ENTITY_UPDATATED, + message: CONSTANTS.apiResponses.ENTITY_UPDATED, result: entityInformation, }) // resolve({ entityInformation, message: CONSTANTS.apiResponses.ENTITYTYPE_UPDATED }) diff --git a/src/module/userRoleExtension/validator/v1.js b/src/module/userRoleExtension/validator/v1.js index 7544a63..1f6a2b9 100644 --- a/src/module/userRoleExtension/validator/v1.js +++ b/src/module/userRoleExtension/validator/v1.js @@ -8,9 +8,21 @@ module.exports = (req) => { let userRoleValidator = { create: function () { - req.checkBody('title').exists().withMessage('required title ') + // req.checkBody('title').exists().withMessage('required title ') req.checkBody('entityTypes[0].entityType').exists().withMessage('entityType name ') req.checkBody('entityTypes[0].entityTypeId').exists().withMessage('entityTypeId name ') + req.checkBody('title') + .exists() + .withMessage('The title field is required.') + .trim() // Removes leading and trailing spaces + .notEmpty() + .withMessage('The title field cannot be empty.') + req.checkBody('userRoleId') + .exists() + .withMessage('The userRoleId field is required.') + .trim() // Removes leading and trailing spaces + .notEmpty() + .withMessage('The userRoleId field cannot be empty.') }, update: function () { req.checkBody('title').exists().withMessage('required title')