user permissions
This commit is contained in:
@@ -11,5 +11,7 @@ export function getApiHeaders(
|
||||
}
|
||||
}
|
||||
|
||||
headers['content-type'] = 'application/json';
|
||||
|
||||
return headers;
|
||||
}
|
||||
|
||||
@@ -34,9 +34,7 @@ export async function getWarrenDirectory(
|
||||
ApiResponse<{ files: DirectoryEntry[] }>
|
||||
>(getApiUrl(`warrens/files`), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
headers: getApiHeaders(),
|
||||
body: JSON.stringify({
|
||||
warrenId,
|
||||
path,
|
||||
@@ -65,9 +63,7 @@ export async function createDirectory(
|
||||
|
||||
const { status } = await useFetch(getApiUrl(`warrens/files/directory`), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
headers: getApiHeaders(),
|
||||
body: JSON.stringify({
|
||||
warrenId,
|
||||
path,
|
||||
@@ -106,9 +102,7 @@ export async function deleteWarrenDirectory(
|
||||
|
||||
const { status } = await useFetch(getApiUrl(`warrens/files/directory`), {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
headers: getApiHeaders(),
|
||||
body: JSON.stringify({
|
||||
warrenId,
|
||||
path,
|
||||
@@ -148,9 +142,7 @@ export async function deleteWarrenFile(
|
||||
|
||||
const { status } = await useFetch(getApiUrl(`warrens/files/file`), {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
headers: getApiHeaders(),
|
||||
body: JSON.stringify({
|
||||
warrenId,
|
||||
path,
|
||||
@@ -209,6 +201,11 @@ export async function uploadToWarren(
|
||||
body.append('files', file);
|
||||
}
|
||||
|
||||
const headers = getApiHeaders();
|
||||
for (const [key, value] of Object.entries(headers)) {
|
||||
xhr.setRequestHeader(key, value);
|
||||
}
|
||||
|
||||
xhr.send(body);
|
||||
|
||||
try {
|
||||
@@ -244,9 +241,7 @@ export async function renameWarrenEntry(
|
||||
|
||||
const { status } = await useFetch(getApiUrl(`warrens/files/rename`), {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
headers: getApiHeaders(),
|
||||
body: JSON.stringify({
|
||||
warrenId,
|
||||
path,
|
||||
|
||||
@@ -21,7 +21,7 @@ export const useWarrenStore = defineStore('warrens', {
|
||||
}
|
||||
|
||||
if (!this.current.path.endsWith('/')) {
|
||||
this.current.path += '/';
|
||||
path = '/' + path;
|
||||
}
|
||||
|
||||
this.current.path += path;
|
||||
|
||||
Reference in New Issue
Block a user