feat: Enhance reservation functionality

This commit is contained in:
2026-04-22 10:23:22 -04:00
parent 7f1e82acc2
commit 534d66c774
25 changed files with 1236 additions and 91 deletions

View File

@@ -193,6 +193,7 @@ import {
IonMenuButton, IonButton, IonIcon, IonCard, IonCardHeader, IonCardTitle,
IonCardSubtitle, IonCardContent, IonList, IonItem, IonLabel, IonToggle,
IonSelect, IonSelectOption, IonSpinner, IonModal, IonInput, IonToast, IonCheckbox,
onIonViewWillEnter,
} from '@ionic/vue'
import {
addOutline, timeOutline, trashOutline, constructOutline, calendarOutline,
@@ -252,12 +253,16 @@ const dateOptions = computed(() => {
return out
})
onMounted(async () => {
async function loadAll() {
await Promise.all([fetchBoats(), fetchTemplates()])
await fetchSlots()
})
}
watch(selectedDate, fetchSlots)
const user = useSupabaseUser()
watch(user, (val) => { if (val) loadAll() }, { immediate: true })
onIonViewWillEnter(() => { if (user.value) loadAll() })
watch(selectedDate, () => { if (user.value) fetchSlots() })
async function fetchBoats() {
const { data } = await supabase.from('boats').select('*').order('name')