mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-30 01:49:40 +05:00
feat: add collection create\edit api request
This commit is contained in:
parent
5cde53c1d3
commit
9f3ca2e6d9
4 changed files with 140 additions and 48 deletions
|
@ -28,11 +28,16 @@ export const fetchDataViaGet = async (
|
|||
export const fetchDataViaPost = async (
|
||||
url: string,
|
||||
body: string,
|
||||
API_V2: string | boolean = false
|
||||
API_V2: string | boolean = false,
|
||||
contentType: string = ""
|
||||
) => {
|
||||
if (API_V2) {
|
||||
HEADERS["API-Version"] = "v2";
|
||||
}
|
||||
if (contentType != "") {
|
||||
HEADERS["Content-Type"] = contentType;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(url, {
|
||||
method: "POST",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue