From 50e23bad35b662321f9dfde22c3d908c8ab4fc3b Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Fri, 20 Jan 2023 19:05:10 +0100 Subject: [PATCH] fix(nuxt): use query for hashing the fetch key (#18411) --- packages/nuxt/src/app/composables/fetch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt/src/app/composables/fetch.ts b/packages/nuxt/src/app/composables/fetch.ts index d14f2c575b..a344eeeab2 100644 --- a/packages/nuxt/src/app/composables/fetch.ts +++ b/packages/nuxt/src/app/composables/fetch.ts @@ -47,7 +47,7 @@ export function useFetch< arg2?: string ) { const [opts = {}, autoKey] = typeof arg1 === 'string' ? [{}, arg1] : [arg1, arg2] - const _key = opts.key || hash([autoKey, unref(opts.baseURL), typeof request === 'string' ? request : '', unref(opts.params)]) + const _key = opts.key || hash([autoKey, unref(opts.baseURL), typeof request === 'string' ? request : '', unref(opts.params || opts.query)]) if (!_key || typeof _key !== 'string') { throw new TypeError('[nuxt] [useFetch] key must be a string: ' + _key) }