Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
allurei committed Dec 28, 2024
1 parent 3ac5aec commit da34d1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/lib/components/ilmoformi.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<div class="wrap">
<div class="flex-items bordered flower-bg">
<h2>Ilmoittautuminen</h2>
{#if form?.error}
{console.log(form?.error)}
{#if form?.body}
{console.log(form?.body)}
{/if}
{#if form?.success !== true}
<form method="POST" use:enhance>
Expand Down
12 changes: 5 additions & 7 deletions src/routes/tesmi/kutsuvieras-ilmo/+page.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ export const actions = {
let body = {};
data.forEach((value, key) => body[key] = value);
body = JSON.stringify(body);
try {

return {
body
}

const response = await fetch('https://api.viiskyt.asteriski.fi/api/participants/', {
method: 'POST',
headers: { "Content-Type": "application/json" },
Expand All @@ -30,11 +34,5 @@ export const actions = {
return fail(400, {
success: false
});
} catch (error) {
console.error(error);
return {
error
}
}
},
};

0 comments on commit da34d1a

Please sign in to comment.