NuxtN
Nuxt9mo ago
5 replies
GaymerPedro4k

getCachedData Not Working

Hi could some give me help getCachedData stopped working and i also disabled purgeCachedData and still doesnt work

const getCurvasCarga = async (cpe: string, data_inicio: string, data_fim: string) => {
        const token = await getAccessTokenSilently();

        return useFetch<any>(`${config.public.apiUrl}curvas-carga`, {
            method: 'GET',
            server: false,
            headers: {
                Authorization: `Bearer ${token}`,
            },
            query: {
                cpe,
                data_inicio,
                data_fim
            },
            getCachedData(key: any) {
                return nuxtApp.payload.data[key] || nuxtApp.static.data[key];
            },
            key: `curvas-carga-${cpe}-${data_inicio}-${data_fim}`,
        });
    };
Was this page helpful?