Skip to content

Commit

Permalink
feat: add getbyidorname
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrelstan committed Jan 26, 2022
1 parent 3808c84 commit 2d6b75c
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions server/models/Wallets.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
import WalletsRepository from '../infra/database/WalletsRepository';
import log from 'loglevel';
import { delegateRepository } from '../infra/database/delegateRepository';

export type Wallets = {
export type Wallet = {
id: string;
name: string;
token_in_wallet: number;
photo_url: string;
};

function getWallets(
walletsRepository: WalletsRepository,
): (filter: any) => Promise<Wallets[]> {
return async function (filter: any) {
const wallets = await walletsRepository.getByFilter(filter);
return wallets;
};
}

export default {
getById: delegateRepository(WalletsRepository, 'getById'),
getWallets,
getByIdOrName: delegateRepository(WalletsRepository, 'getByIdOrName'),
};

0 comments on commit 2d6b75c

Please sign in to comment.