Merge pull request #1975 from atmonshi/refresh-after-delete-user

small improve to Users List
This commit is contained in:
Mike Cao 2023-04-25 12:43:30 -07:00 committed by GitHub
commit 89d37e0045
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,10 +18,15 @@ export function UsersList() {
const { toast, showToast } = useToast();
const hasData = data && data.length !== 0;
const handleSave = () => refetch();
const handleSave = () => {
refetch().then(() => showToast({ message: formatMessage(messages.saved), variant: 'success' }));
};
const handleDelete = () =>
showToast({ message: formatMessage(messages.userDeleted), variant: 'success' });
const handleDelete = () => {
refetch().then(() =>
showToast({ message: formatMessage(messages.userDeleted), variant: 'success' }),
);
};
return (
<Page loading={isLoading} error={error}>