Refactored forms and pages.

This commit is contained in:
Mike Cao 2023-10-07 18:55:14 -07:00
parent 1325abe31d
commit 6253d55790
57 changed files with 209 additions and 208 deletions

View file

@ -8,6 +8,7 @@ import {
Button,
SubmitButton,
} from 'react-basics';
import { setValue } from 'store/cache';
import useApi from 'components/hooks/useApi';
import useMessages from 'components/hooks/useMessages';
@ -20,8 +21,9 @@ export function TeamAddForm({ onSave, onClose }) {
const handleSubmit = async data => {
mutate(data, {
onSuccess: async () => {
onSave();
onClose();
setValue('teams', Date.now());
onSave?.();
onClose?.();
},
});
};