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 6 additions and 9 deletions
Showing only changes of commit d98f0a2493 - Show all commits

View File

@ -8,10 +8,6 @@ module.exports = Self => {
required: true,
description: 'Filter defining where and paginated data',
http: {source: 'query'}
}, {
arg: 'noLimit',
type: 'Boolean',
required: false,
}],
returns: {
type: ['Object'],
@ -20,10 +16,11 @@ module.exports = Self => {
http: {
path: `/getBalance`,
verb: 'GET'
}
},
noLimit: true
});
Self.getBalance = async(ctx, filter, noLimit, options) => {
Self.getBalance = async(ctx, filter, options) => {
const myOptions = {userId: ctx.req.accessToken.userId};
if (typeof options == 'object')

View File

@ -23,7 +23,7 @@ describe('item getBalance()', () => {
date: null
}
};
const results = await models.Item.getBalance(ctx, filter, true, options);
const results = await models.Item.getBalance(ctx, filter, options);
const result = results.find(element => element.clientType == 'loses');
@ -57,8 +57,8 @@ describe('item getBalance()', () => {
}
};
const firstItemBalance = await models.Item.getBalance(ctx, firstFilter, true, options);
const secondItemBalance = await models.Item.getBalance(ctx, secondFilter, true, options);
const firstItemBalance = await models.Item.getBalance(ctx, firstFilter, options);
const secondItemBalance = await models.Item.getBalance(ctx, secondFilter, options);
expect(firstItemBalance[9].claimFk).toEqual(null);
expect(secondItemBalance[7].claimFk).toEqual(1);