chore: refs #7524 rollback
This commit is contained in:
parent
b16c2bed2b
commit
d98f0a2493
|
@ -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')
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue