fixed merge conflicts
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import { deserialize, enhance } from '$app/forms';
|
||||
<script lang="ts">
|
||||
import { deserialize } from '$app/forms';
|
||||
import Alert from '$lib/components/ui/Alert.svelte';
|
||||
import Button from '$lib/components/ui/Button.svelte';
|
||||
import Modal from '$lib/components/ui/Modal/Modal.svelte';
|
||||
@@ -31,15 +31,12 @@
|
||||
$: case_existing = false;
|
||||
|
||||
let name = '';
|
||||
/** @type {?string}*/
|
||||
let etag = null;
|
||||
/** @type {?FileList} */
|
||||
let files = null;
|
||||
let etag: string | null = null;
|
||||
let files: FileList | null = null;
|
||||
|
||||
$: inProgress = form === null;
|
||||
|
||||
/** @type {?Record<string,any>}*/
|
||||
let formErrors;
|
||||
let formErrors: Record<string,any> | null;
|
||||
|
||||
async function validateForm() {
|
||||
let data = new FormData();
|
||||
@@ -58,7 +55,6 @@
|
||||
success = false;
|
||||
}
|
||||
|
||||
console.log('File', files);
|
||||
if (!files?.length) {
|
||||
formErrors = { file: 'Sie haben keine Datei ausgewählt.', ...formErrors };
|
||||
success = false;
|
||||
@@ -89,14 +85,12 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
/** @param {MouseEvent} event*/
|
||||
async function buttonClick(event) {
|
||||
async function buttonClick(event: MouseEvent) {
|
||||
if (!(await validateForm())) {
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
const url = await getUrl();
|
||||
console.log('URL', url);
|
||||
open = true;
|
||||
inProgress = true;
|
||||
|
||||
@@ -104,7 +98,6 @@
|
||||
.then((response) => {
|
||||
inProgress = false;
|
||||
etag = '123';
|
||||
console.log('SUCCESS', response);
|
||||
})
|
||||
.catch((err) => {
|
||||
inProgress = false;
|
||||
@@ -114,7 +107,6 @@
|
||||
}
|
||||
|
||||
function uploadSuccessful() {
|
||||
console.log('reset');
|
||||
open = false;
|
||||
vorgang = '';
|
||||
name = '';
|
||||
|
||||
Reference in New Issue
Block a user