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 = {};
value[field] = newValue;
if (filter) {
const valueData = await model.find(filter, myOptions);
result = await valueData.updateAttribute(field, newValue, myOptions);
if (tx) await tx.commit();
return result;
}
if (filter)
lines = await models.Entry.latestBuysFilter(null, filter, myOptions);// ctx?
// get lines
console.log(lines.length);
const targets = lines.map(line => {
return line[identifier];
});
for (let target of targets)
promises.push(model.upsertWithWhere({id: target}, value, myOptions));

View File

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