mirror of
https://github.com/harivansh-afk/betterNAS.git
synced 2026-04-16 18:03:53 +00:00
user-owned DAVs (#14)
This commit is contained in:
parent
ca5014750b
commit
1bbfb6647d
35 changed files with 732 additions and 777 deletions
|
|
@ -64,10 +64,7 @@ export function isAuthenticated(): boolean {
|
|||
return getToken() !== null;
|
||||
}
|
||||
|
||||
async function apiFetch<T>(
|
||||
path: string,
|
||||
options?: RequestInit,
|
||||
): Promise<T> {
|
||||
async function apiFetch<T>(path: string, options?: RequestInit): Promise<T> {
|
||||
const headers: Record<string, string> = {};
|
||||
const token = getToken();
|
||||
if (token) {
|
||||
|
|
@ -79,7 +76,10 @@ async function apiFetch<T>(
|
|||
|
||||
const response = await fetch(`${API_URL}${path}`, {
|
||||
...options,
|
||||
headers: { ...headers, ...Object.fromEntries(new Headers(options?.headers).entries()) },
|
||||
headers: {
|
||||
...headers,
|
||||
...Object.fromEntries(new Headers(options?.headers).entries()),
|
||||
},
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue