Converted mutation queries.

This commit is contained in:
Mike Cao 2025-08-24 15:20:19 -07:00
parent 3f167e05ba
commit 0f9669f886
34 changed files with 259 additions and 350 deletions

View file

@ -6,14 +6,11 @@ import {
Button,
FormSubmitButton,
} from '@umami/react-zen';
import { useApi, useMessages } from '@/components/hooks';
import { useMessages, useUpdateQuery } from '@/components/hooks';
export function PasswordEditForm({ onSave, onClose }) {
const { formatMessage, labels, messages } = useMessages();
const { post, useMutation } = useApi();
const { mutate, error, isPending } = useMutation({
mutationFn: (data: any) => post('/me/password', data),
});
const { mutate, error, isPending } = useUpdateQuery('/me/password');
const handleSubmit = async (data: any) => {
mutate(data, {