From 534e3a8df39ad2d7d6f0a334246d3b4f2bdc36a1 Mon Sep 17 00:00:00 2001 From: mikheykinnv Date: Tue, 19 Nov 2024 12:37:58 +0800 Subject: [PATCH] MSP-4447 add refetch profile after updateRole --- src/pages/RolesPage/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/RolesPage/index.tsx b/src/pages/RolesPage/index.tsx index 499b0f9..6b5a33f 100644 --- a/src/pages/RolesPage/index.tsx +++ b/src/pages/RolesPage/index.tsx @@ -24,6 +24,8 @@ import { routePaths } from '@routes/routePaths.ts' import { NewRoleType, PermissionKeysType, RoleType } from '@type/roles.type.ts' import './roles-page.scss' +import { useAppDispatch } from '@hooks/redux.ts' +import { fetchProfile } from '@stores/redusers/ActionCreators.ts' const { Column, EmptyData, NoData } = Layout @@ -34,6 +36,7 @@ const RolesPage = () => { const fromApp = location.state?.fromApp || false const { role, hasPermission } = useRole() const [searchParams, setSearchParams] = useSearchParams() + const dispatch = useAppDispatch() const searchValue = searchParams.get('search') || '' const { data: permissionList = [], isLoading: isPermissionLoading } = userServiceApi.useGetAllPermissionsQuery() @@ -97,6 +100,7 @@ const RolesPage = () => { updateRole(formValue as RoleType) .unwrap() .then(() => { + dispatch(fetchProfile()) message.success('Элемент успешно добавлен').then() }) .catch((error) => {