chore: format file
This commit is contained in:
parent
bd1d275d9c
commit
d635ffbc66
1 changed files with 8 additions and 2 deletions
|
|
@ -143,7 +143,13 @@ export async function listFile(path: string[]) {
|
||||||
return (await list("file", path)) as StorageFile[] | boolean;
|
return (await list("file", path)) as StorageFile[] | boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateFile(path: string[], file: string, metadata: FileProps, destPath?: string[], destFile?: string) {
|
export async function updateFile(
|
||||||
|
path: string[],
|
||||||
|
file: string,
|
||||||
|
metadata: FileProps,
|
||||||
|
destPath?: string[],
|
||||||
|
destFile?: string,
|
||||||
|
) {
|
||||||
const res = await fetch(`${STORAGE_URL}/storage/file`, {
|
const res = await fetch(`${STORAGE_URL}/storage/file`, {
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
headers: {
|
headers: {
|
||||||
|
|
@ -152,7 +158,7 @@ export async function updateFile(path: string[], file: string, metadata: FilePro
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
from: { path, file },
|
from: { path, file },
|
||||||
to: destPath && destFile ? { path: destPath, file: destFile,} : undefined,
|
to: destPath && destFile ? { path: destPath, file: destFile } : undefined,
|
||||||
...metadata,
|
...metadata,
|
||||||
upload: false,
|
upload: false,
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue