diff --git a/.changeset/empty-eels-float.md b/.changeset/empty-eels-float.md new file mode 100644 index 000000000..7b38b035a --- /dev/null +++ b/.changeset/empty-eels-float.md @@ -0,0 +1,6 @@ +--- +"druxt": patch +"druxt-router": patch +--- + +Fixed issue with single lingual sites using JSON:API Extras. diff --git a/packages/druxt/src/nuxt/index.js b/packages/druxt/src/nuxt/index.js index 538aafdfd..88d17085e 100644 --- a/packages/druxt/src/nuxt/index.js +++ b/packages/druxt/src/nuxt/index.js @@ -51,7 +51,7 @@ const DruxtNuxtModule = async function (moduleOptions = {}) { // Langcode prefixed API endpoints. const languageResourceType = 'configurable_language--configurable_language' - if (await druxt.getIndex(languageResourceType)) { + if (((await druxt.getIndex(languageResourceType)) || {}).href) { const query = new DrupalJsonApiParams().addFields(languageResourceType, ['drupal_internal__id']) const languages = (await druxt.getCollectionAll(languageResourceType, query) || []) .map((o) => o.data) diff --git a/packages/router/src/nuxt/index.js b/packages/router/src/nuxt/index.js index b073b9a0f..8f0881a8c 100644 --- a/packages/router/src/nuxt/index.js +++ b/packages/router/src/nuxt/index.js @@ -69,7 +69,7 @@ const DruxtRouterNuxtModule = async function (moduleOptions = {}) { proxy: { ...options.proxy || {}, api: false }, }) const languageResourceType = 'configurable_language--configurable_language' - if (await druxt.getIndex(languageResourceType)) { + if (((await druxt.getIndex(languageResourceType)) || {}).href) { const query = new DrupalJsonApiParams().addFields(languageResourceType, ['drupal_internal__id']) languages = (await druxt.getCollectionAll(languageResourceType, query) || []) .map((o) => o.data)