diff --git a/packages/frontend-core/src/api/templates.js b/packages/frontend-core/src/api/templates.js index 3c474dabc6..660a85d745 100644 --- a/packages/frontend-core/src/api/templates.js +++ b/packages/frontend-core/src/api/templates.js @@ -29,7 +29,7 @@ export const buildTemplateEndpoints = API => ({ */ getAppTemplates: async () => { return await API.get({ - url: "/api/templates?type=app", + url: "/api/templates", }) }, }) diff --git a/packages/server/src/api/controllers/templates.js b/packages/server/src/api/controllers/templates.js index 03dbbd2ee2..3a1cafdf5a 100644 --- a/packages/server/src/api/controllers/templates.js +++ b/packages/server/src/api/controllers/templates.js @@ -1,12 +1,13 @@ const fetch = require("node-fetch") const { downloadTemplate } = require("../../utilities/fileSystem") +const env = require("../../environment") // development flag, can be used to test against templates exported locally const DEFAULT_TEMPLATES_BUCKET = "prod-budi-templates.s3-eu-west-1.amazonaws.com" exports.fetch = async function (ctx) { - const { type = "app" } = ctx.query + let type = env.TEMPLATE_REPOSITORY let response, error = false try { diff --git a/packages/server/src/environment.js b/packages/server/src/environment.js index ff1061dbaf..4807ef5493 100644 --- a/packages/server/src/environment.js +++ b/packages/server/src/environment.js @@ -78,6 +78,7 @@ module.exports = { ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS, DISABLE_THREADING: process.env.DISABLE_THREADING, SQL_MAX_ROWS: process.env.SQL_MAX_ROWS, + TEMPLATE_REPOSITORY: process.env.TEMPLATE_REPOSITORY || "app", _set(key, value) { process.env[key] = value module.exports[key] = value