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 defaultLimit = this.app.orm.selectLimit;
|
||||||
const filter = ctx.args.filter || {limit: defaultLimit};
|
const filter = ctx.args.filter || {limit: defaultLimit};
|
||||||
|
|
||||||
if (filter.limit > defaultLimit) {
|
if (!filter.limit || filter.limit > defaultLimit) {
|
||||||
filter.limit = defaultLimit;
|
filter.limit = defaultLimit;
|
||||||
ctx.args.filter = filter;
|
ctx.args.filter = filter;
|
||||||
}
|
}
|
||||||
|
@ -349,9 +349,10 @@ module.exports = function(Self) {
|
||||||
},
|
},
|
||||||
|
|
||||||
hasFilter(ctx) {
|
hasFilter(ctx) {
|
||||||
return ctx.req.method.toUpperCase() === 'GET' &&
|
const {method, req} = ctx;
|
||||||
ctx.method.accepts.some(x => x.arg === 'filter' && x.type.toLowerCase() === 'object');
|
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: {
|
http: {
|
||||||
path: `/getBalance`,
|
path: `/getBalance`,
|
||||||
verb: 'GET'
|
verb: 'GET'
|
||||||
}
|
},
|
||||||
|
noLimit: true
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.getBalance = async(ctx, filter, options) => {
|
Self.getBalance = async(ctx, filter, options) => {
|
||||||
|
|
Loading…
Reference in New Issue