mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-02-06 06:08:16 +00:00
added subscription end
This commit is contained in:
@@ -16,6 +16,7 @@ func NewSubscriptionController(as *services.SubscriptionService, s *gin.RouterGr
|
||||
wc := new(SubscriptionController)
|
||||
wc.SubscriptionService = as
|
||||
|
||||
s.PUT("/end/:id", wc.End)
|
||||
s.POST("", wc.New)
|
||||
s.PUT("/:id", wc.Edit)
|
||||
s.GET("", wc.GetAll)
|
||||
@@ -56,7 +57,7 @@ func (wc *SubscriptionController) Get(c *gin.Context) {
|
||||
body.Id = auth.(*models.Auth).Id
|
||||
|
||||
id := c.Param("id")
|
||||
|
||||
|
||||
embed, _ := c.GetQuery("embed")
|
||||
params.Embed = embed
|
||||
|
||||
@@ -65,6 +66,19 @@ func (wc *SubscriptionController) Get(c *gin.Context) {
|
||||
c.JSON(200, fr)
|
||||
}
|
||||
|
||||
func (wc *SubscriptionController) End(c *gin.Context) {
|
||||
body := new(models.Auth)
|
||||
|
||||
auth := c.MustGet("auth")
|
||||
body.Id = auth.(*models.Auth).Id
|
||||
|
||||
id := c.Param("id")
|
||||
|
||||
fr := wc.SubscriptionService.End(c, id)
|
||||
|
||||
c.JSON(200, fr)
|
||||
}
|
||||
|
||||
func (wc *SubscriptionController) GetAll(c *gin.Context) {
|
||||
body := new(models.Auth)
|
||||
auth := c.MustGet("auth")
|
||||
|
||||
Reference in New Issue
Block a user