4492-item.create-same-as-item.isLaid #1125

Merged
pau merged 10 commits from 4492-item.create-same-as-item.isLaid into dev 2022-11-16 08:04:56 +00:00
1 changed files with 0 additions and 4 deletions
Showing only changes of commit 37292cee89 - Show all commits

View File

@ -51,12 +51,8 @@ module.exports = Self => {
const item = await models.Item.create(params, myOptions);
// set the item.isLaid to be the same as itemType.isLaid (itemType comes from item.typeFk)
const itemType = await models.ItemType.findById(item.typeFk, myOptions);
pau marked this conversation as resolved Outdated
Outdated
Review

Mover esta linea arriba del create para poder crearlo directamente con el valor de la propiedad isLaid

Mover esta linea arriba del create para poder crearlo directamente con el valor de la propiedad isLaid
// Update the item with the new isLaid value
item.isLaid = itemType.isLaid;
await item.save(myOptions);
pau marked this conversation as resolved Outdated
Outdated
Review

Evitar el save para no hacer dos consultas a la bd

Evitar el save para no hacer dos consultas a la bd