I'm having some trouble getting the array in books.value
to log to the console. It continues to return no results even after awaiting the useFind
function. I have confirmed results exist for the value I pass into the query. If I make a change to the code without refreshing my browser, the console.log
will work. What am I doing wrong?
import { useFind } from "feathers-vuex";
async mounted() {
const { Book } = this.$FeathersVuex.api;
const pathBody = this.$route.path.split("/")[1];
const bookParams = computed(() => {
return {
query: {
referral_link: pathBody
}
};
});
const { items: books } = await useFind({
model: Book,
params: bookParams
});
console.log(books.value); // empty array
}