From 702a846de2aede64cbfe48757a8399740e91d884 Mon Sep 17 00:00:00 2001 From: Ryan Block Date: Mon, 18 Dec 2023 14:52:12 -0800 Subject: [PATCH] Add region to environment creation --- src/_write.cjs | 3 ++- src/index.cjs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/_write.cjs b/src/_write.cjs index 2b44c60..639ef0c 100644 --- a/src/_write.cjs +++ b/src/_write.cjs @@ -12,7 +12,8 @@ const { version } = require('../package.json') * @param {object} [body] passthru POST body * @returns {Promise} */ -module.exports = async function write ({ scope = 'apps', token, _staging, appID, envID, path }, body) { +module.exports = async function write (params, body) { + let { scope = 'apps', token, _staging, appID, envID, path } = params const base = await getBase(_staging) if (process.env.__BEGIN_TEST_URL__) token = 'token_redacted' if (!token) throw Error('missing_token') diff --git a/src/index.cjs b/src/index.cjs index 7dc4551..686fef1 100644 --- a/src/index.cjs +++ b/src/index.cjs @@ -165,9 +165,9 @@ module.exports = { * @description add an environment * @param {BaseParams & UniqueApp & {name: string, envName: string}} options */ - async add ({ token, appID, name, envName, _staging }) { + async add ({ token, appID, name, envName, region, _staging }) { if (!appID) throw Error('missing_appID') - return write({ token, appID, _staging }, { envName, name }) + return write({ token, appID, _staging }, { envName, name, region }) }, /**