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 {
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user