fix filter
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2022-04-19 14:12:31 +02:00
parent 8432815cb7
commit 69530d3019
3 changed files with 14 additions and 12 deletions

View File

@ -18,7 +18,7 @@
</span>
<span translate>row(s) have been selected.</span>
<span class="bold link" ng-click="$ctrl.checkDummy()">
{{$ctrl.AllRowsCount}}
{{$ctrl.AllRowsText}}
</span>
</vn-list>
</vn-menu>

View File

@ -151,21 +151,22 @@ export default class MultiCheck extends FormInput {
}
};
this.rows = data.length;
this.$http.get(this.model.url, {params})
.then(res => {
this.AllRows = res.data;
this.AllRowsCount = this.$t('SelectAllRows', {
rows: res.data.length
this.AllRowsCount = res.data.length;
this.AllRowsText = this.$t('SelectAllRows', {
rows: this.AllRowsCount
});
});
this.rows = data.length;
}
checkDummy() {
if (this.checkedDummyCount)
return this.checkedDummyCount = null;
this.checkedDummyCount = this.rows;
this.checkedDummyCount = this.AllRowsCount;
}
/**

View File

@ -1,5 +1,5 @@
module.exports = Self => {
Self.remoteMethod('editLatestBuys', {
Self.remoteMethodCtx('editLatestBuys', {
description: 'Updates a column for one or more buys',
accessType: 'WRITE',
accepts: [{
@ -35,7 +35,7 @@ module.exports = Self => {
}
});
Self.editLatestBuys = async(field, newValue, lines, filter, options) => {
Self.editLatestBuys = async(ctx, field, newValue, lines, filter, options) => {
let tx;
const myOptions = {};
@ -76,11 +76,12 @@ module.exports = Self => {
const value = {};
value[field] = newValue;
if (filter)
lines = await models.Entry.latestBuysFilter(null, filter, myOptions);// ctx?
// get lines
if (filter) {
ctx.args.filter = {where: filter, limit: null};
lines = await models.Buy.latestBuysFilter(ctx, null, myOptions);// ctx?
}
// get lines
console.log(lines.length);
const targets = lines.map(line => {
return line[identifier];
});