fix: routes
ci-api / test (push) Successful in 24m3s

This commit is contained in:
Nuxgrid
2026-07-29 18:42:19 +02:00
parent 9f47ba2902
commit 0848d3c0a0
+4 -8
View File
@@ -52,28 +52,24 @@ func New(d Deps) *gin.Engine {
{ {
authed.POST("/auth/logout", d.AuthH.Logout) authed.POST("/auth/logout", d.AuthH.Logout)
authed.GET("/auth/me", d.AuthH.Me) 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 := authed.Group("")
client.Use(auth.RequireRole(auth.RoleClient)) client.Use(auth.RequireRole(auth.RoleClient))
{ {
client.GET("/leads", d.LeadsH.List) client.GET("/leads", d.LeadsH.List)
client.PATCH("/leads/:id/status", d.LeadsH.SetStatus) client.PATCH("/leads/:id/status", d.LeadsH.SetStatus)
client.POST("/subscription", d.SubH.AddCode) 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). // Espace admin : provisioning des démos (admin uniquement).
admin := authed.Group("") admin := authed.Group("")
admin.Use(auth.RequireRole(auth.RoleAdmin)) admin.Use(auth.RequireRole(auth.RoleAdmin))
{ {
admin.GET("/codes", d.SubH.ListCodes) admin.GET("/codes", d.SubH.ListCodes)
admin.POST("/codes", d.SubH.CreateCodeForBuy) admin.POST("/codes", d.SubH.CreateCodeForBuy)
admin.POST("/profile/username", d.ProfileH.UpdateUsernameById)
admin.POST("/profile/password", d.ProfileH.UpdatePasswordById)
if d.DemosH != nil { if d.DemosH != nil {
admin.POST("/demos", d.DemosH.Create) admin.POST("/demos", d.DemosH.Create)
admin.GET("/demos", d.DemosH.List) admin.GET("/demos", d.DemosH.List)