mirror of
https://github.com/Radiquum/AniX.git
synced 2025-09-05 05:55: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
|
@ -2,7 +2,7 @@ export const CURRENT_APP_VERSION = "3.7.0";
|
|||
import { env } from "next-runtime-env";
|
||||
|
||||
const NEXT_PUBLIC_API_URL = env("NEXT_PUBLIC_API_URL") || null;
|
||||
export const API_URL = "https://api.anixart.app";
|
||||
export const API_URL = NEXT_PUBLIC_API_URL ||"https://api.anixart.app";
|
||||
export const API_PREFIX = NEXT_PUBLIC_API_URL || "/api/proxy";
|
||||
export const USER_AGENT =
|
||||
"AnixartApp/9.0 BETA 5-25062213 (Android 9; SDK 28; arm64-v8a; samsung SM-G975N; en)";
|
||||
|
|
|
@ -323,6 +323,7 @@ export async function _FetchHomePageReleases(
|
|||
|
||||
const data: Object = fetch(url, {
|
||||
method: "POST",
|
||||
headers: HEADERS,
|
||||
body: JSON.stringify(body),
|
||||
})
|
||||
.then((response) => {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -188,6 +188,7 @@ export const CreateCollectionPage = () => {
|
|||
const { data, error } = await tryCatchAPI(
|
||||
fetch(url, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
...collectionInfo,
|
||||
is_private: isPrivate,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue