diff --git a/src/components/master/CreateRole.jsx b/src/components/master/CreateRole.jsx index 35085840..90f608e6 100644 --- a/src/components/master/CreateRole.jsx +++ b/src/components/master/CreateRole.jsx @@ -58,7 +58,7 @@ const onSubmit = (values) => { MasterRespository.createRole(result).then((resp)=>{ setIsLoading(false) - const cachedData = getCachedData( "Application Role" ); + const cachedData = getCachedData( "Role" ); const updatedData = [...cachedData, resp.data]; cacheData("Application Role", updatedData); @@ -66,10 +66,9 @@ const onSubmit = (values) => { onClose() } ).catch( ( err ) => { - showToast(err?.response?.data?.message, "error"); - setIsLoading( false ) - onClose() + showToast(err?.response?.data?.message, "error"); + setIsLoading(false) }) diff --git a/src/components/master/EditRole.jsx b/src/components/master/EditRole.jsx index b3ed81f6..51652f05 100644 --- a/src/components/master/EditRole.jsx +++ b/src/components/master/EditRole.jsx @@ -12,6 +12,9 @@ import showToast from "../../services/toastService"; + + + const updateSchema = z.object({ role: z.string().min(1, { message: "Role is required" }), description: z.string().min(1, { message: "Description is required" })