feat: add notification on success

This commit is contained in:
Théo 2023-09-22 14:41:48 +02:00
parent 3c538499c8
commit 7bdf176611
2 changed files with 12 additions and 2 deletions

View file

@ -47,7 +47,7 @@ export const actions = {
if (res.ok) {
return {
form
success: true
};
}

View file

@ -8,6 +8,7 @@
import Input from '$lib/components/ui/Input.svelte';
import plausible from '$lib/stores/Plausible';
import { addToast } from '$lib/components/Toaster.svelte';
export let data: PageData;
@ -17,7 +18,16 @@
onSubmit() {
submitting = true;
},
onResult() {
onResult({ result }) {
if (result.type === 'success') {
addToast({
data: {
title: 'Succès',
description: 'Vos informations ont été mises à jour.'
}
});
}
submitting = false;
}
});