const getUserTemplate = async (): Promise<any> => { try { const { data } = await useAsyncData(() => requestFetch("/api/template/user", { method: "GET" }) ); return data.value?.body?.templates; } catch (err) { console.log(err); } };
Cannot find name 'refresh'.ts
<div class="flex flex-wrap justify-center sm:justify-start gap-16 mt-4 mx-12 overflow-y-auto h-[28rem]"> <ClientOnly> <Cards v-for="(template, index) in templates" :key="index" :name="template.name" @delete="handleDeleteTemplate(template.id)" @edit="handleEditTemplate(template.id)" @preview="handlePreviewTemplate(template.id)" @statistics="handleStatisticsTemplate(template.id)" /> </ClientOnly></div>
await refresh();
await refreshNuxtData();
const requestFetch = useRequestFetch();