Allow etapi to update attribute fields isInheritable, position

This commit is contained in:
mm21 2023-05-05 18:27:26 +00:00
parent 5ea8226996
commit 26a6ef8c03

View File

@ -17,7 +17,8 @@ function register(router) {
'type': [v.mandatory, v.notNull, v.isAttributeType], 'type': [v.mandatory, v.notNull, v.isAttributeType],
'name': [v.mandatory, v.notNull, v.isString], 'name': [v.mandatory, v.notNull, v.isString],
'value': [v.notNull, v.isString], 'value': [v.notNull, v.isString],
'isInheritable': [v.notNull, v.isBoolean] 'isInheritable': [v.notNull, v.isBoolean],
'position': [v.notNull, v.isInteger]
}; };
eu.route(router, 'post' ,'/etapi/attributes', (req, res, next) => { eu.route(router, 'post' ,'/etapi/attributes', (req, res, next) => {
@ -40,7 +41,9 @@ function register(router) {
}); });
const ALLOWED_PROPERTIES_FOR_PATCH = { const ALLOWED_PROPERTIES_FOR_PATCH = {
'value': [v.notNull, v.isString] 'value': [v.notNull, v.isString],
'isInheritable': [v.notNull, v.isBoolean],
'position': [v.notNull, v.isInteger]
}; };
eu.route(router, 'patch' ,'/etapi/attributes/:attributeId', (req, res, next) => { eu.route(router, 'patch' ,'/etapi/attributes/:attributeId', (req, res, next) => {