updated Application role key in cache when when creating new role

This commit is contained in:
Pramod Mahajan 2025-04-18 12:19:50 +05:30
parent b963f6bad9
commit 21e6b10ad1
2 changed files with 4 additions and 6 deletions

View File

@ -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()
})

View File

@ -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" })