chore: refs #7524 rollback

This commit is contained in:
Jorge Penadés 2024-09-10 13:15:58 +02:00
parent b16c2bed2b
commit d98f0a2493
2 changed files with 6 additions and 9 deletions

View File

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

View File

@ -23,7 +23,7 @@ describe('item getBalance()', () => {
date: null 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'); 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 firstItemBalance = await models.Item.getBalance(ctx, firstFilter, options);
const secondItemBalance = await models.Item.getBalance(ctx, secondFilter, true, options); const secondItemBalance = await models.Item.getBalance(ctx, secondFilter, options);
expect(firstItemBalance[9].claimFk).toEqual(null); expect(firstItemBalance[9].claimFk).toEqual(null);
expect(secondItemBalance[7].claimFk).toEqual(1); expect(secondItemBalance[7].claimFk).toEqual(1);