mirror of
https://github.com/wekan/wekan.git
synced 2025-12-29 13:48:49 +01:00
Add new limit operator
This commit is contained in:
parent
2930e9cadb
commit
62b0d371ee
3 changed files with 16 additions and 2 deletions
|
|
@ -227,6 +227,7 @@ BlazeComponent.extendComponent({
|
|||
'operator-comment': 'comments',
|
||||
'operator-has': 'has',
|
||||
'operator-sort': 'sort',
|
||||
'operator-limit': 'limit',
|
||||
};
|
||||
|
||||
const predicates = {
|
||||
|
|
@ -430,6 +431,16 @@ BlazeComponent.extendComponent({
|
|||
} else {
|
||||
value = predicateTranslations.has[value];
|
||||
}
|
||||
} else if (operator === 'limit') {
|
||||
const limit = parseInt(value, 10);
|
||||
if (isNaN(limit) || limit < 1) {
|
||||
this.parsingErrors.push({
|
||||
tag: 'operator-limit-invalid',
|
||||
value,
|
||||
});
|
||||
} else {
|
||||
value = limit;
|
||||
}
|
||||
}
|
||||
if (Array.isArray(params[operator])) {
|
||||
params[operator].push(value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue