mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 02:06:19 +01:00
Update UsersList.js
show toast after creating user and refresh the list after delete
This commit is contained in:
parent
5027d9d945
commit
8bc0fb92ba
@ -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}>
|
||||
|
Loading…
Reference in New Issue
Block a user