refs #5216 try ACL updateExpeditionState
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Jorge Penadés 2023-07-25 16:32:38 +02:00
parent ea4190f15c
commit fa9dfdf411
3 changed files with 6 additions and 3 deletions

View File

@ -0,0 +1,2 @@
INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`)
VALUES ('ExpeditionState','addExpeditionState','WRITE','ALLOW','ROLE','delivery');

View File

@ -17,7 +17,7 @@ module.exports = Self => {
} }
], ],
http: { http: {
path: `/updateExpeditionState`, path: `/addExpeditionState`,
verb: 'post' verb: 'post'
} }
}); });
@ -52,10 +52,11 @@ module.exports = Self => {
const typeFk = result[0].id; const typeFk = result[0].id;
const newExpeditionState = await models.Self.create({ const newExpeditionState = models.Self.create({
expeditionFk: expedition.expeditionFk, expeditionFk: expedition.expeditionFk,
typeFk, typeFk,
}); });
promises.push(newExpeditionState);
} }
await Promise.all(promises); await Promise.all(promises);

View File

@ -1,4 +1,4 @@
module.exports = function(Self) { module.exports = function(Self) {
require('../methods/expedition-state/filter')(Self); require('../methods/expedition-state/filter')(Self);
require('../methods/expedition-state/updateExpeditionState')(Self); require('../methods/expedition-state/addExpeditionState')(Self);
}; };