mirror of
https://github.com/Radiquum/AniX.git
synced 2025-09-05 22:15:36 +05:00
fix: add missing cors and content-type headers
This commit is contained in:
parent
51c5bf01da
commit
cc9a9c3a2c
14 changed files with 116 additions and 89 deletions
|
@ -42,6 +42,7 @@ export const CommentsAddModal = (props: {
|
|||
|
||||
const res = await fetch(url, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ export const CommentsEditModal = (props: {
|
|||
}
|
||||
const res = await fetch(url, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
"use client";
|
||||
|
||||
import { FileInput, Label, Modal, ModalBody, ModalHeader, useThemeMode } from "flowbite-react";
|
||||
import {
|
||||
FileInput,
|
||||
Label,
|
||||
Modal,
|
||||
ModalBody,
|
||||
ModalHeader,
|
||||
useThemeMode,
|
||||
} from "flowbite-react";
|
||||
import { Spinner } from "../Spinner/Spinner";
|
||||
import useSWR from "swr";
|
||||
import { ENDPOINTS } from "#/api/config";
|
||||
|
@ -143,6 +150,7 @@ export const ProfileEditModal = (props: {
|
|||
const { data, error } = await tryCatchAPI(
|
||||
fetch(`${ENDPOINTS.user.settings.avatar}?token=${props.token}`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: formData,
|
||||
})
|
||||
);
|
||||
|
@ -188,7 +196,7 @@ export const ProfileEditModal = (props: {
|
|||
if (avatarModalProps.croppedImage) {
|
||||
_uploadAvatar();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [avatarModalProps.croppedImage]);
|
||||
|
||||
if (!prefData || !loginData || prefError || loginError) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue