You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use a form action from a component and not from the +page file in the route, I will get a very strange behavior, it will work only if the form is empty.
I have a component that pops up to log in (Which could be a very common use case for any sort of form really):
and this is the +page.server.ts file I have in the /login route
/** @type {import('./$types').Actions} */
export const actions = {
default: async (event) => {
//Will not even start if form has any value in the inputs
console.log("started login");
const data = await event.request.formData();
console.log("data", data);
const email = data.get('email');
const password = data.get('password');
return {
email,
password
}
}
};
I wanted to use the actions feature to get better at Svelte but I just ended up wasting a bunch of time when I could have just assigned values and made the API request from the component itself.
The text was updated successfully, but these errors were encountered:
When trying to use a form action from a component and not from the +page file in the route, I will get a very strange behavior, it will work only if the form is empty.
I have a component that pops up to log in (Which could be a very common use case for any sort of form really):
and this is the +page.server.ts file I have in the /login route
I wanted to use the actions feature to get better at Svelte but I just ended up wasting a bunch of time when I could have just assigned values and made the API request from the component itself.
The text was updated successfully, but these errors were encountered: