be add edit delete user group
This commit is contained in:
21
utils/getjsonreq.utils.go
Normal file
21
utils/getjsonreq.utils.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/gommon/log"
|
||||
)
|
||||
|
||||
func GetJSONRawBody(c echo.Context) map[string]interface{} {
|
||||
|
||||
jsonBody := make(map[string]interface{})
|
||||
err := json.NewDecoder(c.Request().Body).Decode(&jsonBody)
|
||||
if err != nil {
|
||||
|
||||
log.Error("empty json body")
|
||||
return nil
|
||||
}
|
||||
|
||||
return jsonBody
|
||||
}
|
||||
Reference in New Issue
Block a user