mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Global Search, limit 0 is no limit
This commit is contained in:
parent
6938cec583
commit
1f57a3f62e
2 changed files with 7 additions and 2 deletions
|
|
@ -540,12 +540,15 @@ export class Query {
|
||||||
}
|
}
|
||||||
} else if (operator === OPERATOR_LIMIT) {
|
} else if (operator === OPERATOR_LIMIT) {
|
||||||
const limit = parseInt(value, 10);
|
const limit = parseInt(value, 10);
|
||||||
if (isNaN(limit) || limit < 1) {
|
if (isNaN(limit) || limit < 0) {
|
||||||
this.addError(OPERATOR_LIMIT, {
|
this.addError(OPERATOR_LIMIT, {
|
||||||
tag: 'operator-limit-invalid',
|
tag: 'operator-limit-invalid',
|
||||||
value,
|
value,
|
||||||
});
|
});
|
||||||
continue;
|
continue;
|
||||||
|
} else if (limit == 0) {
|
||||||
|
// no limit
|
||||||
|
continue;
|
||||||
} else {
|
} else {
|
||||||
value = limit;
|
value = limit;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -562,8 +562,10 @@ function buildProjection(query) {
|
||||||
sort: 1,
|
sort: 1,
|
||||||
},
|
},
|
||||||
skip,
|
skip,
|
||||||
limit,
|
|
||||||
};
|
};
|
||||||
|
if (limit > 0) {
|
||||||
|
projection.limit = limit;
|
||||||
|
}
|
||||||
|
|
||||||
if (query.getQueryParams().hasOperator(OPERATOR_SORT)) {
|
if (query.getQueryParams().hasOperator(OPERATOR_SORT)) {
|
||||||
const order =
|
const order =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue