mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-02-06 06:08:16 +00:00
list all wallets for current user (WA-9)
This commit is contained in:
@@ -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)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user