From 0848d3c0a07ebffabfed4c7dbc8fc2cce98629d6 Mon Sep 17 00:00:00 2001 From: Nuxgrid Date: Wed, 29 Jul 2026 18:42:19 +0200 Subject: [PATCH] fix: routes --- control-plane/api/internal/router/router.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/control-plane/api/internal/router/router.go b/control-plane/api/internal/router/router.go index da62b22..711c048 100644 --- a/control-plane/api/internal/router/router.go +++ b/control-plane/api/internal/router/router.go @@ -52,28 +52,24 @@ func New(d Deps) *gin.Engine { { authed.POST("/auth/logout", d.AuthH.Logout) authed.GET("/auth/me", d.AuthH.Me) + authed.POST("/profile/username", d.ProfileH.UpdateUsernameById) + authed.POST("/profile/password", d.ProfileH.UpdatePasswordById) + authed.GET("/profile/telegram", d.ProfileH.GetTelegramById) + authed.POST("/profile/telegram", d.ProfileH.SetTelegramById) } - client := authed.Group("") client.Use(auth.RequireRole(auth.RoleClient)) { client.GET("/leads", d.LeadsH.List) client.PATCH("/leads/:id/status", d.LeadsH.SetStatus) client.POST("/subscription", d.SubH.AddCode) - client.POST("/profile/username", d.ProfileH.UpdateUsernameById) - client.POST("/profile/password", d.ProfileH.UpdatePasswordById) - client.GET("/profile/telegram", d.ProfileH.GetTelegramById) - client.POST("/profile/telegram", d.ProfileH.SetTelegramById) } - // Espace admin : provisioning des démos (admin uniquement). admin := authed.Group("") admin.Use(auth.RequireRole(auth.RoleAdmin)) { admin.GET("/codes", d.SubH.ListCodes) admin.POST("/codes", d.SubH.CreateCodeForBuy) - admin.POST("/profile/username", d.ProfileH.UpdateUsernameById) - admin.POST("/profile/password", d.ProfileH.UpdatePasswordById) if d.DemosH != nil { admin.POST("/demos", d.DemosH.Create) admin.GET("/demos", d.DemosH.List)