Closed mattmess1221 closed 1 year ago
N/a
const nuxt = useNuxtApp() console.log(Object.keys(nuxt.payload.data)) // [] await useApiData("...", { key: "somekey" }); console.log(Object.keys(nuxt.payload.data)) // ["$apiPartytrue"]
Provide a custom key to useApiData and compare nuxt.payload.data before and after. No matter what key you use, the key will be true.
useApiData
nuxt.payload.data
true
This line probably got missed when changing the cache key from cache -> key. https://github.com/johannschopplich/nuxt-api-party/blob/4cc65d326edb81255689cde4d95063252efcb08d/src/runtime/composables/useApiData.ts#L125
cache
key
It was also missed in $api https://github.com/johannschopplich/nuxt-api-party/blob/4cc65d326edb81255689cde4d95063252efcb08d/src/runtime/composables/%24api.ts#L86
$api
No response
Good catch!
Environment
N/a
Reproduction
Describe the bug
Provide a custom key to
useApiData
and comparenuxt.payload.data
before and after. No matter what key you use, the key will betrue
.This line probably got missed when changing the cache key from
cache
->key
. https://github.com/johannschopplich/nuxt-api-party/blob/4cc65d326edb81255689cde4d95063252efcb08d/src/runtime/composables/useApiData.ts#L125It was also missed in
$api
https://github.com/johannschopplich/nuxt-api-party/blob/4cc65d326edb81255689cde4d95063252efcb08d/src/runtime/composables/%24api.ts#L86Additional context
No response
Logs
No response