mirror of
https://github.com/docmost/docmost
synced 2025-03-28 21:13:28 +00:00
Show new workspace role on change
This commit is contained in:
parent
407a1aff3b
commit
2bd6422a35
@ -23,7 +23,7 @@ const RoleButton = forwardRef<HTMLButtonElement, RoleButtonProps>(
|
||||
),
|
||||
);
|
||||
|
||||
interface SpaceRoleMenuProps {
|
||||
interface RoleMenuProps {
|
||||
roles: IRoleData[];
|
||||
roleName: string;
|
||||
onChange?: (value: string) => void;
|
||||
@ -35,7 +35,7 @@ export default function RoleSelectMenu({
|
||||
roleName,
|
||||
onChange,
|
||||
disabled,
|
||||
}: SpaceRoleMenuProps) {
|
||||
}: RoleMenuProps) {
|
||||
return (
|
||||
<Menu withArrow>
|
||||
<Menu.Target>
|
||||
|
@ -53,9 +53,10 @@ export function useChangeMemberRoleMutation() {
|
||||
return useMutation<any, Error, any>({
|
||||
mutationFn: (data) => changeMemberRole(data),
|
||||
onSuccess: (data, variables) => {
|
||||
// TODO: change in cache instead
|
||||
notifications.show({ message: "Member role updated successfully" });
|
||||
queryClient.refetchQueries({
|
||||
queryKey: ["workspaceMembers", variables.spaceId],
|
||||
queryKey: ["workspaceMembers"],
|
||||
});
|
||||
},
|
||||
onError: (error) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user