diff options
| author | Zach Berwaldt <zberwaldt@tutamail.com> | 2024-03-15 18:49:43 -0400 |
|---|---|---|
| committer | Zach Berwaldt <zberwaldt@tutamail.com> | 2024-03-15 18:49:43 -0400 |
| commit | 9cae9c1d2a0b4f7fa72f3075541b9ffafe1a7275 (patch) | |
| tree | 960fa4f96a1328861a06d97180da8601af6855da /api/internal/router | |
| parent | 8fab2d03bce82e4dee798ebffb1e93c557f62a4b (diff) | |
Add routes for preference, clean up and add types
Diffstat (limited to 'api/internal/router')
| -rw-r--r-- | api/internal/router/router.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/api/internal/router/router.go b/api/internal/router/router.go index adf96d0..3c86b8c 100644 --- a/api/internal/router/router.go +++ b/api/internal/router/router.go | |||
| @@ -17,13 +17,14 @@ func SetupRouter() *gin.Engine { | |||
| 17 | api := r.Group("api/v1") | 17 | api := r.Group("api/v1") |
| 18 | 18 | ||
| 19 | api.POST("/auth", controllers.AuthHandler) | 19 | api.POST("/auth", controllers.AuthHandler) |
| 20 | api.GET("/sizes", middleware.TokenRequired(), controllers.GetSizes) | ||
| 21 | api.PATCH("/user/preferences", controllers.UpdateUserPreferences) | ||
| 20 | 22 | ||
| 21 | user := api.Group("/user/:uuid") | 23 | user := api.Group("/user/:id") |
| 22 | user.Use(middleware.TokenRequired()) | 24 | user.Use(middleware.TokenRequired()) |
| 23 | { | 25 | { |
| 24 | user.GET("", controllers.GetUser) | 26 | user.GET("", controllers.GetUser) |
| 25 | user.GET("preferences", controllers.GetUserPreferences) | 27 | user.GET("preferences", controllers.GetUserPreferences) |
| 26 | user.PATCH("preferences", controllers.UpdateUserPreferences) | ||
| 27 | } | 28 | } |
| 28 | 29 | ||
| 29 | stats := api.Group("/stats") | 30 | stats := api.Group("/stats") |
