feat: Enhance reservation functionality
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user