f090_magic_strings_refactoring #35

Merged
jared merged 29 commits from f090_magic_strings_refactoring into development 2025-09-30 13:33:27 +02:00
2 changed files with 7 additions and 2 deletions
Showing only changes of commit 1d2769d114 - Show all commits

View File

@@ -9,6 +9,7 @@
import shortenFileSize from '$lib/helper/shortenFileSize.js';
import Exclamation from '$lib/icons/Exclamation.svelte';
import FileRect from '$lib/icons/File-rect.svelte';
import { ROUTE_NAMES } from '../../index.js';
export let form;
@@ -43,7 +44,7 @@
data.append('vorgang', vorgang);
data.append('name', name);
data.append('vorgangPIN', vorgangPIN);
const response = await fetch('?/validate', { method: 'POST', body: data });
const response = await fetch(ROUTE_NAMES.UPLOAD_VALIDATE, { method: 'POST', body: data });
/** @type {import('@sveltejs/kit').ActionResult} */
const result = deserialize(await response.text());
@@ -76,7 +77,7 @@
data.append('type', files[0].type);
data.append('fileName', files[0].name);
}
const response = await fetch('?/url', { method: 'POST', body: data });
const response = await fetch(ROUTE_NAMES.UPLOAD_URL, { method: 'POST', body: data });
/** @type {import('@sveltejs/kit').ActionResult} */
const result = deserialize(await response.text());
if (result.type === 'success') return result.data?.url;

View File

@@ -4,6 +4,10 @@ export const ROUTE_NAMES = {
// (angemeldet)
LIST: '/list',
UPLOAD: '/upload',
// UPLOAD actions
UPLOAD_URL: '/upload?/url',
UPLOAD_VALIDATE: '/upload?/validate',
USERMGMT: '/user-management',
// (token-based)