`refresh` method using `useLazyAsyncData` does nothing

Hello ! I am trying to refetch data on the client using the refresh method, however nothing happens :
const queryData = ref<RouterInput['users']['listUsers']>({
orderBy: 'email',
order: 'asc',
limit: 10,
filters: {
email: '',
first_name: '',
last_name: '',
},
})

const { data: users, refresh, pending, error } = await useLazyAsyncData(() => {
console.log('refresh')
const query = {
...queryData.value,
filters: mapValues(queryData.value.filters, value => value || undefined),
}

return trpc.users.listUsers.query(query)
})

watchDebounced(queryData, async () => {
console.log('refreshWatch')
await refresh()
}, {
debounce: 500,
deep: true,
})
const queryData = ref<RouterInput['users']['listUsers']>({
orderBy: 'email',
order: 'asc',
limit: 10,
filters: {
email: '',
first_name: '',
last_name: '',
},
})

const { data: users, refresh, pending, error } = await useLazyAsyncData(() => {
console.log('refresh')
const query = {
...queryData.value,
filters: mapValues(queryData.value.filters, value => value || undefined),
}

return trpc.users.listUsers.query(query)
})

watchDebounced(queryData, async () => {
console.log('refreshWatch')
await refresh()
}, {
debounce: 500,
deep: true,
})
On the console the log refreshWatch is printed, but refresh does not appear Is this the intended behavior ? Do you need a reproduction ? How could I solve this ? Thanks !
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server