fix: added missing return statement;

refactor: redundant comments
This commit is contained in:
2025-06-25 15:50:07 +03:00
parent cbcfb8a286
commit 69d55ce060

View File

@@ -77,13 +77,13 @@ func RequestMiddleware[T any](role enums.Role) gin.HandlerFunc {
if userInfo.Role < role { if userInfo.Role < role {
c.Status(http.StatusForbidden) c.Status(http.StatusForbidden)
return
} }
var body T var body T
if err := c.ShouldBindJSON(&body); err != nil { if err := c.ShouldBindJSON(&body); err != nil {
c.String(http.StatusBadRequest, err.Error()) c.String(http.StatusBadRequest, err.Error())
// TODO: implement automatic validation here
return return
} }