Skip to content

Commit 5d6f73e

Browse files
committed
feat: add api flags for testing
1 parent d37f000 commit 5d6f73e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/shared/experience/expSite.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,11 @@ export class ExperienceSite {
238238
try {
239239
// Limit API to published sites for now until we have a patch for the issues with unpublished sites
240240
// TODO switch api back to preview mode after issues are addressed
241-
const apiUrl = `${instanceUrl}/services/data/v63.0/sites/${siteIdMinus3}/preview?published`;
241+
let apiUrl = `${instanceUrl}/services/data/v63.0/sites/${siteIdMinus3}/preview?published`;
242+
if (process.env.SITE_API_MODE === 'preview') {
243+
apiUrl = `${instanceUrl}/services/data/v63.0/sites/${siteIdMinus3}/preview`;
244+
}
245+
242246
const response = await axios.get(apiUrl, {
243247
headers: {
244248
Authorization: `Bearer ${accessToken}`,

src/shared/orgUtils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ export class OrgUtils {
160160
* @param connection the connection to the org
161161
*/
162162
public static ensureMatchingAPIVersion(connection: Connection): void {
163+
// Testing purposes only - using this flag may cause local development to not function correctly
164+
if (process.env.SKIP_API_VERSION_CHECK === 'true') {
165+
return;
166+
}
167+
163168
const dirname = path.dirname(url.fileURLToPath(import.meta.url));
164169
const packageJsonFilePath = path.resolve(dirname, '../../package.json');
165170

0 commit comments

Comments
 (0)