Merge pull request #2401 from esdete2/bugfix-user-creation

Fix user creation process
This commit is contained in:
Mike Cao 2023-11-30 14:37:46 -10:00 committed by GitHub
commit d08cba0df7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,12 +1,16 @@
import { Button, Icon, Text, Modal, Icons, ModalTrigger } from 'react-basics'; import { Button, Icon, Text, Modal, Icons, ModalTrigger, useToasts } from 'react-basics';
import UserAddForm from './UserAddForm'; import UserAddForm from './UserAddForm';
import useMessages from 'components/hooks/useMessages'; import useMessages from 'components/hooks/useMessages';
import { setValue } from 'store/cache';
export function UserAddButton({ onSave }) { export function UserAddButton({ onSave }) {
const { formatMessage, labels } = useMessages(); const { formatMessage, labels, messages } = useMessages();
const { showToast } = useToasts();
const handleSave = () => { const handleSave = () => {
onSave(); showToast({ message: formatMessage(messages.saved), variant: 'success' });
setValue('users', Date.now());
onSave?.();
}; };
return ( return (