Beau
Beau
SSolidJS
Created by Beau on 12/24/2023 in #support
Is there a way to grab a throwed error in "action" function
that did the job, thanks 🙂
8 replies
SSolidJS
Created by Beau on 12/24/2023 in #support
Is there a way to grab a throwed error in "action" function
but how does the useSubmission now about the action?
const action = useSubmission(register);
const action = useSubmission(register);
where do i hook it up?
8 replies
SSolidJS
Created by Beau on 12/24/2023 in #support
Is there a way to grab a throwed error in "action" function
How would it look like code wise? Like:
export const register = action(async (data: FormData) => {

const username = data.get("username");
const password = data.get("password");

const repeatPassword = data.get("passwordRepeat");

if(password !== repeatPassword) {
throw redirect("/register?error=...");
}
});
export const register = action(async (data: FormData) => {

const username = data.get("username");
const password = data.get("password");

const repeatPassword = data.get("passwordRepeat");

if(password !== repeatPassword) {
throw redirect("/register?error=...");
}
});
8 replies