From 6a4c981b601d4f9da9f692a766118581cfc4e436 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 1 Apr 2021 11:49:57 +0100 Subject: [PATCH] Update URLs for fetching component libraries to be under api route --- packages/builder/src/builderStore/loadComponentLibraries.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/builderStore/loadComponentLibraries.js b/packages/builder/src/builderStore/loadComponentLibraries.js index e6516f7d79..ed1bdc639c 100644 --- a/packages/builder/src/builderStore/loadComponentLibraries.js +++ b/packages/builder/src/builderStore/loadComponentLibraries.js @@ -6,7 +6,7 @@ import { get } from "builderStore/api" * @param {string} appId - ID of the currently running app */ export const fetchComponentLibDefinitions = async appId => { - const LIB_DEFINITION_URL = `/${appId}/components/definitions` + const LIB_DEFINITION_URL = `/api/${appId}/components/definitions` try { const libDefinitionResponse = await get(LIB_DEFINITION_URL) return await libDefinitionResponse.json() @@ -22,7 +22,7 @@ export const fetchComponentLibDefinitions = async appId => { export const fetchComponentLibModules = async application => { const allLibraries = {} for (let libraryName of application.componentLibraries) { - const LIBRARY_URL = `/${application._id}/componentlibrary?library=${libraryName}` + const LIBRARY_URL = `/api/${application._id}/componentlibrary?library=${libraryName}` allLibraries[libraryName] = await import(LIBRARY_URL) } return allLibraries