Skip to content

Commit

Permalink
fix: change getbyinorname to getwalletbyidname
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrelstan committed Jan 26, 2022
1 parent 5558fe2 commit c77bdc4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/models/Wallets.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ describe('/wallet', () => {
const execute = WalletsModel.getByIdOrName(repo);
const result = await execute(1);
expect(result).toMatchObject(wallets);
expect(repo.getByIdOrName).toBeCalledWith(1);
expect(repo.getWalletByIdOrName).toBeCalledWith(1);
});
});
5 changes: 4 additions & 1 deletion server/models/Wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ export type Wallet = {
};

export default {
getByIdOrName: delegateRepository(WalletsRepository, 'getByIdOrName'),
getWalletByIdOrName: delegateRepository(
WalletsRepository,
'getWalletByIdOrName',
),
};
2 changes: 1 addition & 1 deletion server/routers/walletsRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ router.get(
handlerWrapper(async (req, res, next) => {
Joi.assert(req.params.walletIdOrName, Joi.string().required());
const repo = new WalletsRepository(new Session());
const exe = WalletModel.getByIdOrName(repo);
const exe = WalletModel.getWalletByIdOrName(repo);
const result = await exe(req.params.walletIdOrName);
res.send(result);
res.end();
Expand Down

0 comments on commit c77bdc4

Please sign in to comment.