Skip to content

Commit

Permalink
fix(module): remove transpile for qs
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Jan 17, 2022
1 parent 29350d7 commit cd12e1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ export default defineNuxtModule<ModuleOptions>({
nuxt.hook('autoImports:dirs', (dirs) => {
dirs.push(resolve(runtimeDir, 'composables'))
})

nuxt.options.build.transpile.push('qs')
}
})

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/composables/useStrapiClient.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { FetchError, FetchOptions } from 'ohmyfetch'
import { stringify } from 'qs'
import { default as qs } from 'qs'
import type { Strapi4Error } from '../types/v4'
import type { Strapi3Error } from '../types/v3'
import { useStrapiUrl } from './useStrapiUrl'
Expand Down Expand Up @@ -38,7 +38,7 @@ export const useStrapiClient = () => {

// Map params according to strapi v4 format
if (version === 'v4' && fetchOptions.params) {
url = `${url}?${stringify(fetchOptions.params, { encodeValuesOnly: true })}`
url = `${url}?${qs.stringify(fetchOptions.params, { encodeValuesOnly: true })}`
delete fetchOptions.params
}

Expand Down

0 comments on commit cd12e1b

Please sign in to comment.