Return QA templates when TEST_ENV environmentvariable is set

This commit is contained in:
Peter Clement 2022-05-18 16:21:17 +01:00
parent 11b8d2a8e8
commit 2fb7777c5d
3 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,7 @@ export const buildTemplateEndpoints = API => ({
*/
getAppTemplates: async () => {
return await API.get({
url: "/api/templates?type=app",
url: "/api/templates",
})
},
})

View File

@ -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.TEST_ENV ? "qa" : "app"
let response,
error = false
try {

View File

@ -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,
TEST_ENV: true,
_set(key, value) {
process.env[key] = value
module.exports[key] = value