Skip to content

Commit

Permalink
chore(#158): fix issue with API proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed May 11, 2022
1 parent ec4cc1c commit 52c780b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/druxt/src/nuxt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ const DruxtNuxtModule = async function (moduleOptions = {}) {
...moduleOptions,
...(this.options || {}).druxt,
}
const druxt = new DruxtClient(options.baseUrl, options)

const druxt = new DruxtClient(options.baseUrl, {
...options,
// Disable API Proxy, as Proxies aren't available at build.
proxy: { ...options.proxy || {}, api: false },
})

// Nuxt proxy integration.
if (options.proxy) {
Expand Down
6 changes: 5 additions & 1 deletion packages/router/src/nuxt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ const DruxtRouterNuxtModule = async function (moduleOptions = {}) {
})

// Fetch languages.
const druxt = new DruxtClient(options.baseUrl, options)
const druxt = new DruxtClient(options.baseUrl, {
...options,
// Disable API Proxy, as Proxies aren't available at build.
proxy: { ...options.proxy || {}, api: false },
})
const resourceType = 'configurable_language--configurable_language'
const query = new DrupalJsonApiParams().addFields(resourceType, ['drupal_internal__id'])
const languages = (await druxt.getCollectionAll(resourceType, query) || [])
Expand Down

0 comments on commit 52c780b

Please sign in to comment.