diff --git a/internal/api/user/controller.go b/internal/api/user/controller.go index 212865a..48128f6 100644 --- a/internal/api/user/controller.go +++ b/internal/api/user/controller.go @@ -26,10 +26,10 @@ func newController(service *service, utils interfaces.Utils) *controller { func (h *Handler) RegisterRoutes(r *gin.RouterGroup, authMW gin.HandlerFunc, refreshMW gin.HandlerFunc) { userGroup := r.Group("/user") - userGroup.POST("/", h.controller.register) - userGroup.GET("/", authMW, h.controller.get) - userGroup.PUT("/", authMW, h.controller.update) - userGroup.DELETE("/", authMW, h.controller.delete) + userGroup.POST("", h.controller.register) + userGroup.GET("", authMW, h.controller.get) + userGroup.PUT("", authMW, h.controller.update) + userGroup.DELETE("", authMW, h.controller.delete) //auth h.controller.authPath = fmt.Sprintf("%s/user/auth", h.apiPrefix) diff --git a/internal/api/user/repository.go b/internal/api/user/repository.go index 87d2b2d..4b0b754 100644 --- a/internal/api/user/repository.go +++ b/internal/api/user/repository.go @@ -40,7 +40,7 @@ func (r *repo) getByUuid(userUuid string) (user User, err error) { } func (r *repo) update(user map[string]any) error { - return r.db.Where("uuid = ?", user["uuid"]).Updates(&user).Error + return r.db.Model(&User{}).Where("uuid = ?", user["uuid"]).Updates(&user).Error } func (r *repo) delete(userUuid string) error {