feat: add collection create\edit api request

This commit is contained in:
Kentai Radiquum 2024-08-17 22:51:06 +05:00
parent 5cde53c1d3
commit 9f3ca2e6d9
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
4 changed files with 140 additions and 48 deletions

View file

@ -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",