added clearSelection after disable user

This commit is contained in:
Elyor Djalilov 2024-07-04 15:38:08 +05:00
parent 1a412eb31a
commit 2c2d4001e7
2 changed files with 12 additions and 4 deletions

View File

@ -13,6 +13,7 @@ const DisableUserDialog = ({
isLoading,
fetchData,
updateUserStatus,
clearSelection,
}) => {
const onlyOneUser = userIds.length === 1;
@ -30,10 +31,16 @@ const DisableUserDialog = ({
bodyText = bodyText + t("ChangeUserStatusDialog:DisableGeneralDescription");
const onClickDisableUser = async () => {
await updateUserStatus(EmployeeStatus.Disabled, userIds);
toastr.success(t("PeopleTranslations:SuccessChangeUserStatus"));
await fetchData();
onClose();
try {
await updateUserStatus(EmployeeStatus.Disabled, userIds);
toastr.success(t("PeopleTranslations:SuccessChangeUserStatus"));
await fetchData();
} catch (error) {
toastr.error(error);
} finally {
clearSelection();
onClose();
}
};
return (

View File

@ -161,6 +161,7 @@ const Sessions = ({
fetchData={fetchData}
userIds={userIds}
updateUserStatus={updateUserStatus}
clearSelection={clearSelection}
/>
)}