development #1

Merged
titus merged 12 commits from development into main 2025-05-14 13:42:23 +02:00
2 changed files with 16 additions and 1 deletions
Showing only changes of commit 617033fccb - Show all commits

View File

@@ -139,6 +139,11 @@
if (!response.ok) {
if (response.status == 400) {
let json_res = await response.json()
alert(json_res['msg'])
return;
}
throw new Error(`Fehlgeschlagen: ${response.status}`)
} else {
setTimeout(() => {window.location.reload()}, 500)

View File

@@ -11,10 +11,20 @@ export async function PUT({ request }) {
// Vorgang
let vorgang = request.url.split('/').at(-1)
// copy
// prepare copy, incl. check if new name exists already
let old_name = data["old_name"]
let src_full_path = `/tatort/${vorgang}/${old_name}`
let new_name = `${vorgang}/${data["new_name"]}`
try {
let file_stats = await client.statObject('tatort', new_name)
return json({ msg: 'Die Datei existiert bereits.' }, { status: 400 })
} catch (error) {
// continue operation
console.log('continue operation')
}
// actual copy operation
await client.copyObject('tatort', new_name, src_full_path)
// delete