feat: add notification on success
This commit is contained in:
parent
3c538499c8
commit
7bdf176611
2 changed files with 12 additions and 2 deletions
|
@ -47,7 +47,7 @@ export const actions = {
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
return {
|
return {
|
||||||
form
|
success: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
import Input from '$lib/components/ui/Input.svelte';
|
import Input from '$lib/components/ui/Input.svelte';
|
||||||
|
|
||||||
import plausible from '$lib/stores/Plausible';
|
import plausible from '$lib/stores/Plausible';
|
||||||
|
import { addToast } from '$lib/components/Toaster.svelte';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
|
@ -17,7 +18,16 @@
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
submitting = true;
|
submitting = true;
|
||||||
},
|
},
|
||||||
onResult() {
|
onResult({ result }) {
|
||||||
|
if (result.type === 'success') {
|
||||||
|
addToast({
|
||||||
|
data: {
|
||||||
|
title: 'Succès',
|
||||||
|
description: 'Vos informations ont été mises à jour.'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
submitting = false;
|
submitting = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue