Skip to content

Commit

Permalink
fix: remove deposits count (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
amateima authored Dec 16, 2024
1 parent c9d1ff9 commit 25631af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/modules/deposit/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,13 @@ export class DepositService {
query = query.take(limit);
query = query.skip(offset);

const [userDeposits, total] = await query.getManyAndCount();
const userDeposits = await query.getMany();

return {
deposits: userDeposits.map(formatDeposit),
pagination: {
limit,
offset,
total,
},
};
}
Expand Down
4 changes: 2 additions & 2 deletions test/deposit.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ describe("GET /deposits", () => {
);
expect(response.status).toBe(200);
expect(response.body.deposits).toHaveLength(5);
expect(response.body.pagination).toMatchObject({ limit: 5, offset: 0, total: FILLED_DEPOSITS.length });
expect(response.body.pagination).toMatchObject({ limit: 5, offset: 0 });
expect(response.body.deposits[0].depositId).toBe(19);
});

it("200 with status=filled & limit=5 & skip=5", async () => {
const response = await request(app.getHttpServer()).get("/deposits?status=filled&limit=5&offset=5");
expect(response.status).toBe(200);
expect(response.body.deposits).toHaveLength(5);
expect(response.body.pagination).toMatchObject({ limit: 5, offset: 5, total: FILLED_DEPOSITS.length });
expect(response.body.pagination).toMatchObject({ limit: 5, offset: 5 });
expect(response.body.deposits[0].depositId).toBe(14);
});

Expand Down

0 comments on commit 25631af

Please sign in to comment.