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 = {};
|
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));
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
returns: {
|
returns: {
|
||||||
type: ['Object'],
|
type: ['object'],
|
||||||
root: true
|
root: true
|
||||||
},
|
},
|
||||||
http: {
|
http: {
|
||||||
|
|
Loading…
Reference in New Issue