// CreateAction creates a new role
CreateAction creates a new role
// CreateAction creates a new role
func (rc RoleController) CreateAction(c *gin.Context) {
	rReq := mrequest.RoleCreate{}
	json.NewDecoder(c.Request.Body).Decode(&rReq)
	e := errors.ValidateRequest(&rReq)
	if e != nil {
		c.JSON(e.HttpCode, e)
		return
	}
	rRes, err := rc.RoleService.CreateOne(&rReq)
	if err != nil {
		c.JSON(err.HttpCode, err)
		return
	}
	c.JSON(200, rRes)
}
func ( rc RoleController ) CreateAction ( c * gin . Context ) { rReq := mrequest . RoleCreate { } json . NewDecoder ( c . Request . Body ) . Decode ( & rReq ) e := errors . ValidateRequest ( & rReq ) if e != nil { c . JSON ( e . HttpCode , e ) return } rRes , err := rc . RoleService . CreateOne ( & rReq ) if err != nil { c . JSON ( err . HttpCode , err ) return } c . JSON ( 200 , rRes ) }
CreateAction creates a new role
CreateAction creates a new role