fix build + fix lint

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2023-01-31 23:00:53 +01:00 committed by Gitea
parent 49c46f9f72
commit 5328d3f4ed
2 changed files with 11 additions and 13 deletions

View file

@ -6,7 +6,7 @@
const form = useForm();
$: submit = async (event: Event) => {
// @ts-ignore
// @ts-expect-error FormData makes tsc sad
const formData = new URLSearchParams(new FormData(event.target as HTMLFormElement));
promise = self

View file

@ -1,18 +1,16 @@
<script lang="ts">
import { goto } from '$app/navigation';
let promise = self
.fetch(`/api/logout`, {
method: 'post'
})
.then(async (response) => {
if (response.ok) {
goto('/');
} else {
const res = await response.json();
throw new Error(res.message);
}
});
let promise = fetch(`/api/logout`, {
method: 'post'
}).then(async (response) => {
if (response.ok) {
goto('/');
} else {
const res = await response.json();
throw new Error(res.message);
}
});
</script>
{#await promise}