Convert useModified into a real hook.

This commit is contained in:
Mike Cao 2024-02-07 23:48:51 -08:00
parent a426c242cb
commit 91e3dff7f5
24 changed files with 63 additions and 48 deletions

View file

@ -8,14 +8,14 @@ import {
Button,
SubmitButton,
} from 'react-basics';
import { useApi, useMessages } from 'components/hooks';
import { touch } from 'store/modified';
import { useApi, useMessages, useModified } from 'components/hooks';
export function TeamJoinForm({ onSave, onClose }: { onSave: () => void; onClose: () => void }) {
const { formatMessage, labels, getMessage } = useMessages();
const { post, useMutation } = useApi();
const { mutate, error } = useMutation({ mutationFn: (data: any) => post('/teams/join', data) });
const ref = useRef(null);
const { touch } = useModified();
const handleSubmit = async (data: any) => {
mutate(data, {