Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(nuxt)!: only add $f fetch prefix to auto-keys (#8852)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 10, 2022
1 parent 1496d3a commit 1709934
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/composables/fetch.ts
Expand Up @@ -51,7 +51,7 @@ export function useFetch<
if (!request) {
throw new Error('[nuxt] [useFetch] request is missing.')
}
const key = '$f' + _key
const key = _key === autoKey ? '$f' + _key : _key

const _request = computed(() => {
let r = request
Expand Down
2 changes: 1 addition & 1 deletion test/basic.test.ts
Expand Up @@ -778,7 +778,7 @@ describe.skipIf(process.env.NUXT_TEST_DEV || isWindows)('payload rendering', ()
it('renders a payload', async () => {
const payload = await $fetch('/random/a/_payload.js', { responseType: 'text' })
expect(payload).toMatch(
/export default \{data:\{\$frand_a:\[[^\]]*\]\},prerenderedAt:\d*\}/
/export default \{data:\{rand_a:\[[^\]]*\]\},prerenderedAt:\d*\}/
)
})

Expand Down

0 comments on commit 1709934

Please sign in to comment.