Added SettingsContext.
This commit is contained in:
@@ -9,6 +9,8 @@ import {
|
||||
} from 'react-basics';
|
||||
import useApi from 'components/hooks/useApi';
|
||||
import useMessages from 'components/hooks/useMessages';
|
||||
import { useContext } from 'react';
|
||||
import SettingsContext from '../../SettingsContext';
|
||||
|
||||
const CONFIRM_VALUE = 'RESET';
|
||||
|
||||
@@ -22,9 +24,10 @@ export function WebsiteResetForm({
|
||||
onClose?: () => void;
|
||||
}) {
|
||||
const { formatMessage, labels, messages, FormattedMessage } = useMessages();
|
||||
const { websitesUrl } = useContext(SettingsContext);
|
||||
const { post, useMutation } = useApi();
|
||||
const { mutate, error } = useMutation({
|
||||
mutationFn: (data: any) => post(`/websites/${websiteId}/reset`, data),
|
||||
mutationFn: (data: any) => post(`${websitesUrl}/${websiteId}/reset`, data),
|
||||
});
|
||||
|
||||
const handleSubmit = async (data: any) => {
|
||||
|
||||
Reference in New Issue
Block a user