mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 02:25:35 +01:00
Convert all mutate to mutateAsync.
This commit is contained in:
parent
980e4e6b41
commit
6faf16e9aa
32 changed files with 78 additions and 97 deletions
|
|
@ -10,10 +10,10 @@ import { useMessages, useUpdateQuery } from '@/components/hooks';
|
|||
|
||||
export function TeamJoinForm({ onSave, onClose }: { onSave: () => void; onClose: () => void }) {
|
||||
const { formatMessage, labels, getErrorMessage } = useMessages();
|
||||
const { mutate, error, isPending, touch } = useUpdateQuery('/teams/join');
|
||||
const { mutateAsync, error, touch } = useUpdateQuery('/teams/join');
|
||||
|
||||
const handleSubmit = async (data: any) => {
|
||||
mutate(data, {
|
||||
await mutateAsync(data, {
|
||||
onSuccess: async () => {
|
||||
touch('teams:members');
|
||||
onSave?.();
|
||||
|
|
@ -33,9 +33,7 @@ export function TeamJoinForm({ onSave, onClose }: { onSave: () => void; onClose:
|
|||
</FormField>
|
||||
<FormButtons>
|
||||
<Button onPress={onClose}>{formatMessage(labels.cancel)}</Button>
|
||||
<FormSubmitButton variant="primary" isLoading={isPending} isDisabled={isPending}>
|
||||
{formatMessage(labels.join)}
|
||||
</FormSubmitButton>
|
||||
<FormSubmitButton variant="primary">{formatMessage(labels.join)}</FormSubmitButton>
|
||||
</FormButtons>
|
||||
</Form>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue