feat: Enhance reservation functionality
This commit is contained in:
@@ -128,7 +128,7 @@ import {
|
||||
IonPage, IonHeader, IonToolbar, IonTitle, IonContent, IonButtons,
|
||||
IonMenuButton, IonButton, IonIcon, IonCard, IonCardHeader, IonCardTitle,
|
||||
IonCardContent, IonList, IonItem, IonLabel, IonInput, IonSpinner,
|
||||
IonModal, IonAlert, IonToast,
|
||||
IonModal, IonAlert, IonToast, onIonViewWillEnter,
|
||||
} from '@ionic/vue'
|
||||
import { addOutline, pencilOutline, trashOutline, closeOutline } from 'ionicons/icons'
|
||||
import type { Database, TimeTuple } from '~/types/supabase'
|
||||
@@ -153,7 +153,9 @@ const form = reactive<{ name: string; tuples: [string, string][] }>({
|
||||
tuples: [['08:00', '12:00']],
|
||||
})
|
||||
|
||||
onMounted(fetchTemplates)
|
||||
const user = useSupabaseUser()
|
||||
watch(user, (val) => { if (val) fetchTemplates() }, { immediate: true })
|
||||
onIonViewWillEnter(() => { if (user.value) fetchTemplates() })
|
||||
|
||||
async function fetchTemplates() {
|
||||
loading.value = true
|
||||
|
||||
Reference in New Issue
Block a user