I am using an watch to check if appStore.storeID has changed, if it does change and the value is greater than zero it should trigger a Supabase database Fetch.
<script setup>
//import Store Data
import { useAppStore } from '~/store/app';
//set Store as a Constant
const appStore = useAppStore();
const supabase = useSupabaseClient();
watch(
() => appStore.storeID,
() => {
if (appStore.storeID > 0) {
const { data } = await supabase
.from('productinfo_testv12')
.select('*')
.eq('id');
}
}
);
</script>
I am getting this error back
[@vue/compiler-sfc] Unexpected reserved word 'await'. (14:23)
I am expecting this to return a const {data} that can be used within the template.