Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this fix #251 #252

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion client/src/pages/user/Roles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ const Roles = () => {

const onUpdate = async (data: { isEditing: boolean }) => {
fetchRoles();
openSnackBar(successTrans('create', { name: userTrans('role') }));
openSnackBar(
successTrans(data.isEditing ? 'update' : 'create', {
name: userTrans('role'),
})
);
handleCloseDialog();
};

Expand Down
4 changes: 3 additions & 1 deletion client/src/pages/user/UpdateRoleDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ const UpdateRoleDialog: FC<CreateRoleProps> = ({
};

const onChange = (newSelection: any) => {
setForm(v => ({ ...v, privileges: [...newSelection] }));
setForm(v => {
return { ...v, privileges: [...newSelection] };
});
};

const optionGroups: PrivilegeOptionsProps[] = [
Expand Down
2 changes: 1 addition & 1 deletion server/src/users/users.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export class UserController {

try {
// revoke all
this.userService.revokeAllRolePrivileges({ roleName });
await this.userService.revokeAllRolePrivileges({ roleName });

// assign new user roles
for (let i = 0; i < privileges.length; i++) {
Expand Down
Loading