fix: fixed the incorrect parts
This commit is contained in:
parent
d8bf7297fb
commit
605c5cb6eb
@ -2,7 +2,7 @@ import { createURL, fetchURL, removePrefix, removeTusEndpoint } from "./utils";
|
||||
import { baseURL } from "@/utils/constants";
|
||||
import store from "@/store";
|
||||
import { upload as postTus, useTus } from "./tus";
|
||||
import {tusEndpoint} from "../utils/constants";
|
||||
import { tusEndpoint } from "../utils/constants";
|
||||
|
||||
export async function fetch(url) {
|
||||
url = removePrefix(url);
|
||||
@ -90,7 +90,7 @@ export async function post(url, content = "", overwrite = false, onupload) {
|
||||
// Tus is disabled / not applicable
|
||||
!(await useTus(content));
|
||||
if (!useResourcesApi) {
|
||||
url = removeTusEndpoint(tusEndpoint, url)
|
||||
url = removeTusEndpoint(tusEndpoint, url);
|
||||
}
|
||||
return useResourcesApi
|
||||
? postResources(url, content, overwrite, onupload)
|
||||
|
||||
@ -8,7 +8,6 @@ export async function fetchURL(url, opts, auth = true) {
|
||||
opts.headers = opts.headers || {};
|
||||
|
||||
let { headers, ...rest } = opts;
|
||||
|
||||
let res;
|
||||
try {
|
||||
res = await fetch(`${baseURL}${url}`, {
|
||||
@ -85,4 +84,4 @@ export function removeTusEndpoint(tusEndpoint, url) {
|
||||
return url.substring(tusEndpoint.length);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user