list all wallets for current user (WA-9)

This commit is contained in:
Fran Jurmanović
2021-05-29 21:50:48 +02:00
parent 9531cc14fb
commit 035ed4b486
7 changed files with 63 additions and 6 deletions

View File

@@ -29,3 +29,10 @@ func (as *WalletService) Get(am *models.Auth, embed string) *models.Wallet {
return wm
}
func (as *WalletService) GetAll(am *models.Auth, filtered *models.FilteredResponse) {
wm := new([]models.Wallet)
query := as.Db.Model(wm).Where("? = ?", pg.Ident("user_id"), am.Id)
FilteredResponse(query, wm, filtered)
}