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

@@ -17,7 +17,7 @@ func NewWalletsController(as *services.WalletService, s *gin.RouterGroup) *Walle
wc.WalletService = as
s.POST("", wc.New)
s.GET("", wc.Get)
s.GET("", wc.GetAll)
return wc
}
@@ -48,3 +48,16 @@ func (wc *WalletsController) Get(c *gin.Context) {
c.JSON(200, wm)
}
func (wc *WalletsController) GetAll(c *gin.Context) {
body := new(models.Auth)
auth := c.MustGet("auth")
body.Id = auth.(*models.Auth).Id
fr := FilteredResponse(c)
wc.WalletService.GetAll(body, fr)
c.JSON(200, fr)
}