Skip to content

Commit

Permalink
Merge branch 'development' into 256-infinite-scroll-on-big-screen
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet authored May 23, 2017
2 parents e50fbf2 + 8be477f commit 17e25af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/services/api/accountApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ app.factory('AccountApi', function ($q, Peers, Account) {
* @param {String} address - The address of the account to get transactions list for
* @param {Number} [limit = 20] - The maximum number of items in list
* @param {Number} [offset = 0] - The offset index
* @param {String} [orderBy = 'timestamp:desc'] - How is the list ordered
*/
this.transactions.get = (address, limit = 20, offset = 0) => Peers.sendRequestPromise('transactions', {
this.transactions.get = (address, limit = 20, offset = 0, orderBy = 'timestamp:desc') => Peers.sendRequestPromise('transactions', {
senderId: address,
recipientId: address,
limit,
offset,
orderBy,
});

return this;
Expand Down
3 changes: 2 additions & 1 deletion test/services/api/accountApi.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ describe('Factory: AccountApi', () => {
});
});

describe('transaction.get(address, limit, offset)', () => {
describe('transaction.get(address, limit, offset, orderBy)', () => {
it('returns Peers.sendRequest(\'transactions\', options);', () => {
const options = {
senderId: '537318935439898807L',
recipientId: '537318935439898807L',
limit: 20,
offset: 0,
orderBy: 'timestamp:desc',
};

const spy = sinon.spy(peers, 'sendRequestPromise');
Expand Down

0 comments on commit 17e25af

Please sign in to comment.