generated from Greenstand/treetracker-microservice-template
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9492aee
commit eeff066
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import WalletsRepository from '../infra/database/WalletsRepository'; | ||
import log from 'loglevel'; | ||
import { delegateRepository } from '../infra/database/delegateRepository'; | ||
|
||
export type Wallets = { | ||
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, | ||
}; |