diff --git a/components/codev/RecetteBarre.vue b/components/codev/RecetteBarre.vue new file mode 100644 index 0000000..5a79ea5 --- /dev/null +++ b/components/codev/RecetteBarre.vue @@ -0,0 +1,49 @@ + + + diff --git a/components/evenements/Formulaire.vue b/components/evenements/Formulaire.vue index 189f6b2..74e1f4e 100644 --- a/components/evenements/Formulaire.vue +++ b/components/evenements/Formulaire.vue @@ -2,12 +2,18 @@
-

Merci, c'est noté.

-

Jules vous écrit avec les détails.

+ +
- -
+ +

C'est complet.

Écrivez-nous : {{ contact }}

@@ -140,13 +146,16 @@
-

{{ evenement.codev.prixJour }} € par jour, par virement ; les coordonnées vous arrivent par email.

+

+ Les {{ evenement.codev.capacite }} places sont prises : votre inscription va sur la liste d'attente. +

+

{{ evenement.codev.prixJour }} € par jour, par virement ; les coordonnées vous arrivent par email.

Rien à régler.

@@ -184,6 +193,8 @@ const f = reactive({ const err = ref>({}) const etat = ref<'saisie' | 'envoi' | 'ok' | 'complet' | 'indisponible'>('saisie') const erreurEnvoi = ref('') +/** Le serveur a mis l'inscription en liste d'attente (codev complet). */ +const attente = ref(false) const confirmation = ref(null) const id = (k: string) => `fi-${props.page}-${k}` @@ -228,7 +239,8 @@ async function envoyer() { err.value = {} etat.value = 'envoi' try { - await $fetch('/api/evenements/inscription', { method: 'POST', body }) + const r = await $fetch<{ ok: boolean; attente?: boolean }>('/api/evenements/inscription', { method: 'POST', body }) + attente.value = !!r?.attente etat.value = 'ok' emit('inscrit') nextTick(() => confirmation.value?.focus()) diff --git a/components/evenements/Page.vue b/components/evenements/Page.vue index 7d24393..1ad6449 100644 --- a/components/evenements/Page.vue +++ b/components/evenements/Page.vue @@ -3,6 +3,8 @@