feat: refs #7524 no apply limit #2921

Merged
jorgep merged 8 commits from 7524-hotfix-addNoLimit into master 2024-09-10 14:48:21 +00:00
2 changed files with 8 additions and 6 deletions

View File

@ -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');
},
});
};

View File

@ -16,7 +16,8 @@ module.exports = Self => {
http: {
path: `/getBalance`,
verb: 'GET'
}
},
noLimit: true
});
Self.getBalance = async(ctx, filter, options) => {