Skip to content

Commit

Permalink
feat: change id to walletidorname
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrelstan committed Jan 26, 2022
1 parent 8cdb82a commit 3808c84
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions server/routers/walletsRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import Session from '../infra/database/Session';
import WalletsRepository from '../infra/database/WalletsRepository';

const router = express.Router();

router.get(
'/:id',
'/:walletIdOrName',
handlerWrapper(async (req, res, next) => {
Joi.assert(req.params.walletIdOrName, Joi.string().required());
const repo = new WalletsRepository(new Session());
// console.log(repo);
const exe = WalletModel.getWallets(repo);
const result = await exe(req.params.id);
const exe = WalletModel.getByIdOrName(repo);
const result = await exe(req.params.walletIdOrName);
res.send(result);
res.end();
}),
Expand Down

0 comments on commit 3808c84

Please sign in to comment.