From c77bdc4d9836f9751e644701423956214e9ed580 Mon Sep 17 00:00:00 2001 From: Stanley Pierre-Louis Date: Wed, 26 Jan 2022 12:07:55 -0400 Subject: [PATCH] fix: change getbyinorname to getwalletbyidname --- server/models/Wallets.spec.ts | 2 +- server/models/Wallets.ts | 5 ++++- server/routers/walletsRouter.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/server/models/Wallets.spec.ts b/server/models/Wallets.spec.ts index c59e038b..be1219cd 100644 --- a/server/models/Wallets.spec.ts +++ b/server/models/Wallets.spec.ts @@ -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); }); }); diff --git a/server/models/Wallets.ts b/server/models/Wallets.ts index 1d608853..f6956333 100644 --- a/server/models/Wallets.ts +++ b/server/models/Wallets.ts @@ -9,5 +9,8 @@ export type Wallet = { }; export default { - getByIdOrName: delegateRepository(WalletsRepository, 'getByIdOrName'), + getWalletByIdOrName: delegateRepository( + WalletsRepository, + 'getWalletByIdOrName', + ), }; diff --git a/server/routers/walletsRouter.ts b/server/routers/walletsRouter.ts index c96f90dc..1e108f73 100644 --- a/server/routers/walletsRouter.ts +++ b/server/routers/walletsRouter.ts @@ -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();