routes + repo fix
This commit is contained in:
parent
8186d8a46c
commit
88fcbfe1a5
2 changed files with 5 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue