refactor
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2022-04-13 14:58:46 +02:00
parent 04f993e227
commit 8432815cb7
2 changed files with 5 additions and 10 deletions

View File

@ -76,19 +76,14 @@ module.exports = Self => {
const value = {}; const value = {};
value[field] = newValue; value[field] = newValue;
if (filter) { if (filter)
const valueData = await model.find(filter, myOptions); lines = await models.Entry.latestBuysFilter(null, filter, myOptions);// ctx?
result = await valueData.updateAttribute(field, newValue, myOptions); // get lines
if (tx) await tx.commit();
return result;
}
console.log(lines.length);
const targets = lines.map(line => { const targets = lines.map(line => {
return line[identifier]; return line[identifier];
}); });
for (let target of targets) for (let target of targets)
promises.push(model.upsertWithWhere({id: target}, value, myOptions)); promises.push(model.upsertWithWhere({id: target}, value, myOptions));

View File

@ -86,7 +86,7 @@ module.exports = Self => {
} }
], ],
returns: { returns: {
type: ['Object'], type: ['object'],
root: true root: true
}, },
http: { http: {