Merge pull request 'feat: refs #7524 no apply limit' (!2921) from 7524-hotfix-addNoLimit into master
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2921 Reviewed-by: Juan Ferrer <juan@verdnatura.es>
This commit is contained in:
commit
b10ad7527a
|
@ -33,7 +33,7 @@ module.exports = function(Self) {
|
|||
const defaultLimit = this.app.orm.selectLimit;
|
||||
const filter = ctx.args.filter || {limit: defaultLimit};
|
||||
|
||||
if (filter.limit > defaultLimit) {
|
||||
if (!filter.limit || filter.limit > defaultLimit) {
|
||||
filter.limit = defaultLimit;
|
||||
ctx.args.filter = filter;
|
||||
}
|
||||
|
@ -349,9 +349,10 @@ module.exports = function(Self) {
|
|||
},
|
||||
|
||||
hasFilter(ctx) {
|
||||
return ctx.req.method.toUpperCase() === 'GET' &&
|
||||
ctx.method.accepts.some(x => x.arg === 'filter' && x.type.toLowerCase() === 'object');
|
||||
}
|
||||
|
||||
const {method, req} = ctx;
|
||||
if (method.noLimit) return false;
|
||||
return req.method.toUpperCase() === 'GET' &&
|
||||
method.accepts.some(x => x.arg === 'filter' && x.type.toLowerCase() === 'object');
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
|
@ -16,7 +16,8 @@ module.exports = Self => {
|
|||
http: {
|
||||
path: `/getBalance`,
|
||||
verb: 'GET'
|
||||
}
|
||||
},
|
||||
noLimit: true
|
||||
});
|
||||
|
||||
Self.getBalance = async(ctx, filter, options) => {
|
||||
|
|
Loading…
Reference in New Issue