chore: finish profile
ci-api / test (push) Failing after 11m37s
ci-web / test (push) Successful in 14m39s

This commit is contained in:
Nuxgrid
2026-07-29 14:50:31 +02:00
parent 5a0c1bfe3f
commit 6beabfb070
16 changed files with 137 additions and 527 deletions
+2 -4
View File
@@ -12,7 +12,6 @@ import (
"github.com/omnex/control-plane/api/internal/httpx"
"github.com/omnex/control-plane/api/internal/leads"
"github.com/omnex/control-plane/api/internal/profile"
"github.com/omnex/control-plane/api/internal/sav"
"github.com/omnex/control-plane/api/internal/session"
"github.com/omnex/control-plane/api/internal/sub"
)
@@ -26,7 +25,6 @@ type Deps struct {
LeadsH *leads.Handler
DemosH *demos.Handler
SubH *sub.Handler
ContactH *sav.Handler
ProfileH *profile.Handler
}
@@ -48,7 +46,6 @@ func New(d Deps) *gin.Engine {
api.POST("/auth/login", httpx.RateLimit(1, 5), d.AuthH.Login)
api.POST("/auth/register", httpx.RateLimit(0.2, 3), d.AuthH.Register)
api.POST("/leads", httpx.RateLimit(1, 3), d.LeadsH.Create)
api.POST("/send/message", httpx.RateLimit(1, 3), d.ContactH.CallSupport)
// Toute route authentifiée (session valide, n'importe quel rôle).
authed := api.Group("")
authed.Use(auth.RequireAuth(d.Issuer, d.Sessions))
@@ -65,6 +62,8 @@ func New(d Deps) *gin.Engine {
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).
@@ -73,7 +72,6 @@ func New(d Deps) *gin.Engine {
{
admin.GET("/codes", d.SubH.ListCodes)
admin.POST("/codes", d.SubH.CreateCodeForBuy)
admin.GET("/messages", d.ContactH.GetMessage)
admin.POST("/profile/username", d.ProfileH.UpdateUsernameById)
admin.POST("/profile/password", d.ProfileH.UpdatePasswordById)
if d.DemosH != nil {