mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
Fix issues with basePath.
This commit is contained in:
parent
1e8c1d0d18
commit
339cd21596
15 changed files with 66 additions and 51 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import React, { useState } from 'react';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import { Formik, Form, Field } from 'formik';
|
||||
import { post } from 'lib/web';
|
||||
import Button from 'components/common/Button';
|
||||
import FormLayout, {
|
||||
FormButtons,
|
||||
|
|
@ -11,7 +10,7 @@ import FormLayout, {
|
|||
} from 'components/layout/FormLayout';
|
||||
import Checkbox from 'components/common/Checkbox';
|
||||
import { DOMAIN_REGEX } from 'lib/constants';
|
||||
import { useRouter } from 'next/router';
|
||||
import usePost from 'hooks/usePost';
|
||||
|
||||
const initialValues = {
|
||||
name: '',
|
||||
|
|
@ -35,11 +34,11 @@ const validate = ({ name, domain }) => {
|
|||
};
|
||||
|
||||
export default function WebsiteEditForm({ values, onSave, onClose }) {
|
||||
const { basePath } = useRouter();
|
||||
const post = usePost();
|
||||
const [message, setMessage] = useState();
|
||||
|
||||
const handleSubmit = async values => {
|
||||
const { ok, data } = await post(`${basePath}/api/website`, values);
|
||||
const { ok, data } = await post('/api/website', values);
|
||||
|
||||
if (ok) {
|
||||
onSave();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue