fix: added missing return statement;
refactor: redundant comments
This commit is contained in:
@@ -77,13 +77,13 @@ func RequestMiddleware[T any](role enums.Role) gin.HandlerFunc {
|
||||
|
||||
if userInfo.Role < role {
|
||||
c.Status(http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
|
||||
var body T
|
||||
if err := c.ShouldBindJSON(&body); err != nil {
|
||||
c.String(http.StatusBadRequest, err.Error())
|
||||
|
||||
// TODO: implement automatic validation here
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user