diff --git a/src/components/Table/EditableTable.jsx b/src/components/Table/EditableTable.jsx index 1d1a2eb..90f06ab 100644 --- a/src/components/Table/EditableTable.jsx +++ b/src/components/Table/EditableTable.jsx @@ -18,7 +18,8 @@ export const makeActionHandler = (action, { service, setLoader, errorMsg, onComp else if (action === 'delete') await service.delete(record.id) } - onComplete?.() + if (onComplete) + await onComplete() }, setLoader, errorMsg diff --git a/src/pages/AdminPanel/PermissionController.jsx b/src/pages/AdminPanel/PermissionController.jsx index 3d9e236..8390a73 100644 --- a/src/pages/AdminPanel/PermissionController.jsx +++ b/src/pages/AdminPanel/PermissionController.jsx @@ -24,7 +24,7 @@ export const PermissionController = () => { const [showLoader, setShowLoader] = useState(false) const [permissions, setPermissions] = useState([]) - const updateTable = () => invokeWebApiWrapperAsync( + const updateTable = async () => invokeWebApiWrapperAsync( async () => { const permission = await AdminPermissionService.getAll() setPermissions(permission ?? []) @@ -33,7 +33,7 @@ export const PermissionController = () => { `Не удалось загрузить список прав` ) - useEffect(updateTable, []) + useEffect(() => updateTable(), []) const handlerProps = { service: AdminPermissionService,