diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-04-25 14:08:35 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-04-25 14:08:35 +0300 |
| commit | cc3ff61ae215bdaec0c1ae0c3ee232156015c6b4 (patch) | |
| tree | 0c4e9f1544b1cd50e03a22fa9a9b94838f90e511 /web/controller/inbound.go | |
| parent | 045717010a74fa609670caf495458d8ffc99f98f (diff) | |
update by client id
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'web/controller/inbound.go')
| -rw-r--r-- | web/controller/inbound.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/web/controller/inbound.go b/web/controller/inbound.go index ec37dcc7..7b86e2b4 100644 --- a/web/controller/inbound.go +++ b/web/controller/inbound.go @@ -35,7 +35,7 @@ func (a *InboundController) initRouter(g *gin.RouterGroup) { g.POST("/clearClientIps/:email", a.clearClientIps) g.POST("/addClient", a.addInboundClient) g.POST("/:id/delClient/:clientId", a.delInboundClient) - g.POST("/updateClient/:index", a.updateInboundClient) + g.POST("/updateClient/:clientId", a.updateInboundClient) g.POST("/:id/resetClientTraffic/:email", a.resetClientTraffic) g.POST("/resetAllTraffics", a.resetAllTraffics) g.POST("/resetAllClientTraffics/:id", a.resetAllClientTraffics) @@ -199,20 +199,16 @@ func (a *InboundController) delInboundClient(c *gin.Context) { } func (a *InboundController) updateInboundClient(c *gin.Context) { - index, err := strconv.Atoi(c.Param("index")) - if err != nil { - jsonMsg(c, I18n(c, "pages.inbounds.revise"), err) - return - } + clientId := c.Param("clientId") inbound := &model.Inbound{} - err = c.ShouldBind(inbound) + err := c.ShouldBind(inbound) if err != nil { jsonMsg(c, I18n(c, "pages.inbounds.revise"), err) return } - err = a.inboundService.UpdateInboundClient(inbound, index) + err = a.inboundService.UpdateInboundClient(inbound, clientId) if err != nil { jsonMsg(c, "something worng!", err) return |
