updated Application role key in cache when when creating new role
This commit is contained in:
parent
b963f6bad9
commit
21e6b10ad1
@ -58,7 +58,7 @@ const onSubmit = (values) => {
|
|||||||
|
|
||||||
MasterRespository.createRole(result).then((resp)=>{
|
MasterRespository.createRole(result).then((resp)=>{
|
||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
const cachedData = getCachedData( "Role" );
|
const cachedData = getCachedData( "Application Role" );
|
||||||
const updatedData = [...cachedData, resp.data];
|
const updatedData = [...cachedData, resp.data];
|
||||||
|
|
||||||
cacheData("Application Role", updatedData);
|
cacheData("Application Role", updatedData);
|
||||||
@ -66,9 +66,10 @@ const onSubmit = (values) => {
|
|||||||
onClose()
|
onClose()
|
||||||
} ).catch( ( err ) =>
|
} ).catch( ( err ) =>
|
||||||
{
|
{
|
||||||
|
|
||||||
showToast(err?.response?.data?.message, "error");
|
showToast(err?.response?.data?.message, "error");
|
||||||
setIsLoading( false )
|
setIsLoading( false )
|
||||||
|
onClose()
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,9 +12,6 @@ import showToast from "../../services/toastService";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const updateSchema = z.object({
|
const updateSchema = z.object({
|
||||||
role: z.string().min(1, { message: "Role is required" }),
|
role: z.string().min(1, { message: "Role is required" }),
|
||||||
description: z.string().min(1, { message: "Description is required" })
|
description: z.string().min(1, { message: "Description is required" })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user