refactor
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
04f993e227
commit
8432815cb7
|
@ -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));
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ module.exports = Self => {
|
|||
}
|
||||
],
|
||||
returns: {
|
||||
type: ['Object'],
|
||||
type: ['object'],
|
||||
root: true
|
||||
},
|
||||
http: {
|
||||
|
|
Loading…
Reference in New Issue