Skip to content

Commit

Permalink
try default form action
Browse files Browse the repository at this point in the history
  • Loading branch information
allurei committed Dec 28, 2024
1 parent 4f12684 commit 89d1456
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/ilmoformi.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="flex-items bordered flower-bg">
<h2>Ilmoittautuminen</h2>
{#if form?.success !== true}
<form method="POST" action="?/{invited ? 'invited' : 'invited'}" use:enhance>
<form method="POST" use:enhance>
<div class="flex-item twelve row">
<a href=".">Etusivulle</a>
<a href="/tesmi/participants">Ilmoittautuneet</a>
Expand Down
4 changes: 2 additions & 2 deletions src/routes/tesmi/kutsuvieras-ilmo/+page.server.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { fail } from '@sveltejs/kit';

export const actions = {
invited: async ({ request }) => {
default: async ({ request }) => {
const data = await request.formData();

let body = {};
data.forEach((value, key) => body[key] = value);
body = JSON.stringify(body);

const response = await fetch('https://api.viiskyt.asteriski.fi/api/participants/', {
const response = await fetch('http://127.0.0.1:8000/api/participants/', {
method: 'POST',
headers: { "Content-Type": "application/json" },
body
Expand Down

0 comments on commit 89d1456

Please sign in to comment.