hey, why my carTypes variable is not refreshed when availableOnly ref is changing?
<script setup>
const availableOnly = ref(false);
const {data: {value: {carTypes}}} = await useAsyncData(
() =>
$fetch("/api/car-types", {
query: {
"start-date": route.query.startDate,
"end-date": route.query.endDate,
"available-only": availableOnly.value,
},
}),
{
watch: [availableOnly],
},
);
</script>
<template>
// thing that changes availableOnly
{{availableOnly}} // this is changing
{{carTypes === undefined}}} // this returns true
{{carTypes}} // this is not showing
</template>
when i change replace const availableOnly = ref(false); with const availableOnly = ref(true); data is fetched but still doesn't react to ref changes.
thanks for help