added requested changes, refs #4492 @40m

This commit is contained in:
Pau 2022-11-10 07:17:54 +01:00
parent 37292cee89
commit 638fd62aae
2 changed files with 5 additions and 7 deletions

View File

@ -49,14 +49,12 @@ module.exports = Self => {
const provisionalName = params.provisionalName;
delete params.provisionalName;
const itemType = await models.ItemType.findById(params.typeFk, myOptions);
params.isLaid = itemType.isLaid;
const item = await models.Item.create(params, myOptions);
const itemType = await models.ItemType.findById(item.typeFk, myOptions);
item.isLaid = itemType.isLaid;
await item.save(myOptions);
const typeTags = await models.ItemTypeTag.find({
where: {itemTypeFk: item.typeFk}
}, myOptions);

View File

@ -28,7 +28,7 @@
"type": "number"
},
"isLaid": {
"type": "number"
"type": "boolean"
}
},
"relations": {