From 21e6b10ad11210a999d9ab82c5b110e408563ac7 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Fri, 18 Apr 2025 12:19:50 +0530 Subject: [PATCH] updated Application role key in cache when when creating new role --- src/components/master/CreateRole.jsx | 7 ++++--- src/components/master/EditRole.jsx | 3 --- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/master/CreateRole.jsx b/src/components/master/CreateRole.jsx index 90f608e6..35085840 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( "Role" ); + const cachedData = getCachedData( "Application Role" ); const updatedData = [...cachedData, resp.data]; cacheData("Application Role", updatedData); @@ -66,9 +66,10 @@ const onSubmit = (values) => { onClose() } ).catch( ( err ) => { - showToast(err?.response?.data?.message, "error"); - setIsLoading(false) + setIsLoading( false ) + onClose() + }) diff --git a/src/components/master/EditRole.jsx b/src/components/master/EditRole.jsx index 51652f05..b3ed81f6 100644 --- a/src/components/master/EditRole.jsx +++ b/src/components/master/EditRole.jsx @@ -12,9 +12,6 @@ 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" })