Updated website, team and user save.

This commit is contained in:
Mike Cao 2024-01-29 03:15:22 -08:00
parent 2fa50892d8
commit fec81695e8
15 changed files with 128 additions and 117 deletions

View file

@ -1,6 +1,4 @@
import { useApi, useMessages } from 'components/hooks';
import { useContext } from 'react';
import SettingsContext from '../../SettingsContext';
import TypeConfirmationForm from 'components/common/TypeConfirmationForm';
const CONFIRM_VALUE = 'DELETE';
@ -15,10 +13,9 @@ export function WebsiteDeleteForm({
onClose?: () => void;
}) {
const { formatMessage, labels } = useMessages();
const { websitesUrl } = useContext(SettingsContext);
const { del, useMutation } = useApi();
const { mutate, isPending, error } = useMutation({
mutationFn: (data: any) => del(`${websitesUrl}/${websiteId}`, data),
mutationFn: (data: any) => del(`/websites/${websiteId}`, data),
});
const handleConfirm = async () => {