From fd9071da5b2827d33aafdc06a62666882a9e3116 Mon Sep 17 00:00:00 2001 From: Andrii Solokh <158148964+andrii-solokh-mnfd@users.noreply.github.com> Date: Fri, 20 Sep 2024 12:07:21 +0300 Subject: [PATCH] fix: Winter 25 - Legacy redirections disabled, CPQ set settings --- src/commands/texei/cpqsettings/set.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/commands/texei/cpqsettings/set.ts b/src/commands/texei/cpqsettings/set.ts index aec1462..d194c4b 100644 --- a/src/commands/texei/cpqsettings/set.ts +++ b/src/commands/texei/cpqsettings/set.ts @@ -224,8 +224,19 @@ export default class Set extends SfCommand { return `${instanceUrlClean}/secur/frontdoor.jsp?sid=${accessToken}`; } - // eslint-disable-next-line class-methods-use-this - private async getSettingURL(urlOfInstance: string) { - return `${urlOfInstance.substring(0, urlOfInstance.indexOf('.'))}--sbqq.visualforce.com/apex/EditSettings`; + private async getSettingURL(urlOfInstance: string): Promise { + let prefix; + + if (this.org.isScratch()) { + prefix = "--sbqq.scratch"; + } else if (this.org.isSandbox()) { + prefix = "--sbqq.sandbox"; + } else { + prefix = "--sbqq"; + } + + const ending = `${prefix}.vf.force.com/apex/EditSettings` + + return `${urlOfInstance.substring(0, urlOfInstance.indexOf('.'))}${ending}`; } }