Skip to content

Commit

Permalink
refactor(user): update controller register
Browse files Browse the repository at this point in the history
  • Loading branch information
joaofnds committed Mar 5, 2024
1 parent f397650 commit 7454736
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions user/http/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ type Controller struct {
}

func (controller *Controller) Register(app *fiber.App) {
app.Post("/users", controller.Create)
app.Get("/users", controller.List)

userGroup := app.Group("/users/:name", controller.middlewareGetUser, featureflags.Middleware)
userGroup.Get("/", controller.Get)
userGroup.Delete("/", controller.Delete)
userGroup.Get("/feature", controller.GetFeature)
app.Group("/users").
Post("/", controller.Create).
Get("/", controller.List)

app.Group("/users/:name", controller.middlewareGetUser, featureflags.Middleware).
Get("/", controller.Get).
Delete("/", controller.Delete).
Get("/feature", controller.GetFeature)
}

func (controller *Controller) List(ctx *fiber.Ctx) error {
Expand Down

0 comments on commit 7454736

Please sign in to comment.