|
@@ -93,13 +93,18 @@ const UserGroupPage: FC = () => {
|
|
|
name: userGroupData.name,
|
|
name: userGroupData.name,
|
|
|
description: userGroupData.description,
|
|
description: userGroupData.description,
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
toastSuccess(t('toaster.update_successed', { target: t('UserGroup') }));
|
|
toastSuccess(t('toaster.update_successed', { target: t('UserGroup') }));
|
|
|
|
|
+
|
|
|
|
|
+ // mutate
|
|
|
await mutateUserGroups();
|
|
await mutateUserGroups();
|
|
|
|
|
+
|
|
|
|
|
+ hideCreateModal();
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
toastError(err);
|
|
toastError(err);
|
|
|
}
|
|
}
|
|
|
- }, [t, mutateUserGroups]);
|
|
|
|
|
|
|
+ }, [t, mutateUserGroups, hideCreateModal]);
|
|
|
|
|
|
|
|
const updateUserGroup = useCallback(async(userGroupData: IUserGroupHasId) => {
|
|
const updateUserGroup = useCallback(async(userGroupData: IUserGroupHasId) => {
|
|
|
try {
|
|
try {
|
|
@@ -107,13 +112,18 @@ const UserGroupPage: FC = () => {
|
|
|
name: userGroupData.name,
|
|
name: userGroupData.name,
|
|
|
description: userGroupData.description,
|
|
description: userGroupData.description,
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
toastSuccess(t('toaster.update_successed', { target: t('UserGroup') }));
|
|
toastSuccess(t('toaster.update_successed', { target: t('UserGroup') }));
|
|
|
|
|
+
|
|
|
|
|
+ // mutate
|
|
|
await mutateUserGroups();
|
|
await mutateUserGroups();
|
|
|
|
|
+
|
|
|
|
|
+ hideUpdateModal();
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
toastError(err);
|
|
toastError(err);
|
|
|
}
|
|
}
|
|
|
- }, [t, mutateUserGroups]);
|
|
|
|
|
|
|
+ }, [t, mutateUserGroups, hideUpdateModal]);
|
|
|
|
|
|
|
|
const deleteUserGroupById = useCallback(async(deleteGroupId: string, actionName: string, transferToUserGroupId: string) => {
|
|
const deleteUserGroupById = useCallback(async(deleteGroupId: string, actionName: string, transferToUserGroupId: string) => {
|
|
|
try {
|
|
try {
|
|
@@ -151,7 +161,7 @@ const UserGroupPage: FC = () => {
|
|
|
|
|
|
|
|
<UserGroupModal
|
|
<UserGroupModal
|
|
|
buttonLabel={t('Create')}
|
|
buttonLabel={t('Create')}
|
|
|
- onClickButton={createUserGroup}
|
|
|
|
|
|
|
+ onClickSubmit={createUserGroup}
|
|
|
isShow={isCreateModalShown}
|
|
isShow={isCreateModalShown}
|
|
|
onHide={hideCreateModal}
|
|
onHide={hideCreateModal}
|
|
|
/>
|
|
/>
|
|
@@ -159,7 +169,7 @@ const UserGroupPage: FC = () => {
|
|
|
<UserGroupModal
|
|
<UserGroupModal
|
|
|
userGroup={selectedUserGroup}
|
|
userGroup={selectedUserGroup}
|
|
|
buttonLabel={t('Update')}
|
|
buttonLabel={t('Update')}
|
|
|
- onClickButton={updateUserGroup}
|
|
|
|
|
|
|
+ onClickSubmit={updateUserGroup}
|
|
|
isShow={isUpdateModalShown}
|
|
isShow={isUpdateModalShown}
|
|
|
onHide={hideUpdateModal}
|
|
onHide={hideUpdateModal}
|
|
|
/>
|
|
/>
|