Skip to content

Commit

Permalink
fix: modified error for duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
anisha-raju committed Aug 24, 2022
1 parent 7b6b15d commit cac3a9a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 31 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ $ npm install -g @salesforce/commerce
$ sfdx COMMAND
running command...
$ sfdx (-v|--version|version)
@salesforce/commerce/240.0.36 darwin-arm64 node-v18.4.0
@salesforce/commerce/240.0.37 darwin-arm64 node-v18.4.0
$ sfdx --help [COMMAND]
USAGE
$ sfdx COMMAND
Expand Down Expand Up @@ -174,7 +174,7 @@ EXAMPLE
sfdx commerce:examples:convert -f store-scratch-def.json
```

_See code: [src/commands/commerce/examples/convert.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.36/src/commands/commerce/examples/convert.ts)_
_See code: [src/commands/commerce/examples/convert.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.37/src/commands/commerce/examples/convert.ts)_

## `sfdx commerce:extension:map [-r <string>] [-n <string>] [-i <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Expand Down Expand Up @@ -209,7 +209,7 @@ EXAMPLES
sfdx commerce:extension:map --registered-extension-name test-extension-name --store-id test-store-id
```

_See code: [src/commands/commerce/extension/map.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.36/src/commands/commerce/extension/map.ts)_
_See code: [src/commands/commerce/extension/map.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.37/src/commands/commerce/extension/map.ts)_

## `sfdx commerce:extension:points:list [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Expand All @@ -236,7 +236,7 @@ EXAMPLE
sfdx commerce:extension:getEPN
```

_See code: [src/commands/commerce/extension/points/list.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.36/src/commands/commerce/extension/points/list.ts)_
_See code: [src/commands/commerce/extension/points/list.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.37/src/commands/commerce/extension/points/list.ts)_

## `sfdx commerce:extension:register [-r <string>] [-e <string>] [-a <string>] [-m <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Expand Down Expand Up @@ -278,7 +278,7 @@ EXAMPLE
--apex-class-name test-apex-class
```

_See code: [src/commands/commerce/extension/register.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.36/src/commands/commerce/extension/register.ts)_
_See code: [src/commands/commerce/extension/register.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.37/src/commands/commerce/extension/register.ts)_

## `sfdx commerce:files:copy [name=value...] --filestocopy <array> --dirstocopy <array> --copysourcepath <string> [-y] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Expand Down Expand Up @@ -319,7 +319,7 @@ EXAMPLES
"dir1,dir2,dir3"
```

_See code: [src/commands/commerce/files/copy.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.36/src/commands/commerce/files/copy.ts)_
_See code: [src/commands/commerce/files/copy.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.37/src/commands/commerce/files/copy.ts)_

## `sfdx commerce:payments:quickstart:setup -n <string> [-p <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Expand Down Expand Up @@ -351,7 +351,7 @@ EXAMPLE
sfdx commerce:payments:quickstart:setup -p Stripe
```

_See code: [src/commands/commerce/payments/quickstart/setup.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.36/src/commands/commerce/payments/quickstart/setup.ts)_
_See code: [src/commands/commerce/payments/quickstart/setup.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.37/src/commands/commerce/payments/quickstart/setup.ts)_

## `sfdx commerce:products:import -n <string> [-c <string>] [-f <filepath>] [-o <string>] [-y] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Expand Down Expand Up @@ -399,7 +399,7 @@ EXAMPLE
sfdx commerce:products:import --store-name test-store
```

_See code: [src/commands/commerce/products/import.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.36/src/commands/commerce/products/import.ts)_
_See code: [src/commands/commerce/products/import.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.37/src/commands/commerce/products/import.ts)_

## `sfdx commerce:store:create [name=value...] -n <string> [-f <filepath>] [-o <string>] [-y] [-t <string>] [-b <string>] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Expand Down Expand Up @@ -450,7 +450,7 @@ EXAMPLE
sfdx commerce:store:create --store-name test-store
```

_See code: [src/commands/commerce/store/create.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.36/src/commands/commerce/store/create.ts)_
_See code: [src/commands/commerce/store/create.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.37/src/commands/commerce/store/create.ts)_

## `sfdx commerce:store:display -n <string> [-b <string>] [-p <string>] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Expand Down Expand Up @@ -491,7 +491,7 @@ EXAMPLE
sfdx commerce:store:display --store-name test-store
```

_See code: [src/commands/commerce/store/display.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.36/src/commands/commerce/store/display.ts)_
_See code: [src/commands/commerce/store/display.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.37/src/commands/commerce/store/display.ts)_

## `sfdx commerce:store:open -n <string> [--all] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Expand Down Expand Up @@ -530,7 +530,7 @@ EXAMPLES
sfdx commerce:store:open --all
```

_See code: [src/commands/commerce/store/open.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.36/src/commands/commerce/store/open.ts)_
_See code: [src/commands/commerce/store/open.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.37/src/commands/commerce/store/open.ts)_

## `sfdx commerce:store:quickstart:create [name=value...] -n <string> [-t <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Expand Down Expand Up @@ -563,7 +563,7 @@ EXAMPLE
sfdx commerce:store:quickstart:create --templatename 'b2c-lite-storefront'
```

_See code: [src/commands/commerce/store/quickstart/create.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.36/src/commands/commerce/store/quickstart/create.ts)_
_See code: [src/commands/commerce/store/quickstart/create.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.37/src/commands/commerce/store/quickstart/create.ts)_

## `sfdx commerce:store:quickstart:setup [name=value...] -n <string> [-f <filepath>] [-y] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Expand Down Expand Up @@ -604,7 +604,7 @@ EXAMPLE
sfdx commerce:store:quickstart:setup --definitionfile store-scratch-def.json
```

_See code: [src/commands/commerce/store/quickstart/setup.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.36/src/commands/commerce/store/quickstart/setup.ts)_
_See code: [src/commands/commerce/store/quickstart/setup.ts](https://github.com/forcedotcom/commerce-on-lightning/blob/v240.0.37/src/commands/commerce/store/quickstart/setup.ts)_

<!-- commandsstop -->
<!-- debugging-your-plugin -->
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@salesforce/commerce",
"version": "240.0.36",
"version": "240.0.37",
"author": "Jonathan Arndt",
"bugs": "https://github.com/forcedotcom/commerce-on-lightning/issues",
"dependencies": {
Expand Down
33 changes: 16 additions & 17 deletions src/commands/commerce/extension/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export class MapExtension extends SfdxCommand {
}
private deleteDuplicateMaps(extensionName: string, userName: string, storeid: string): void {
let epnVal: string;
let deletedId: string;
const EPNQuery = forceDataSoql(
`SELECT ExtensionPointName FROM RegisteredExternalService WHERE DeveloperName='${extensionName}'`,
userName
Expand All @@ -159,23 +160,21 @@ export class MapExtension extends SfdxCommand {
const id = (element['ExternalServiceProviderType'] as string)
.concat('__' as string)
.concat(element['DeveloperName'] as string);
try {
const deleteId = forceDataSoql(
`SELECT Id FROM StoreIntegratedService WHERE Integration='${id}' AND StoreId='${storeid}'`,
userName
).result.records[0].Id;
if (deleteId !== undefined) {
this.ux.log(
msgs.getMessage('extension.map.previousEPN', [
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`'${element['DeveloperName']}'`,
'because it was for the same EPN in this webstore',
])
);
forceDataRecordDelete('StoreIntegratedService', deleteId, this.org.getUsername(), 'ignore');
}
// eslint-disable-next-line no-empty
} catch (e) {}
const deleteId = forceDataSoql(
`SELECT Id FROM StoreIntegratedService WHERE Integration='${id}' AND StoreId='${storeid}'`,
userName
).result.records[0];
if (deleteId !== undefined) {
deletedId = deleteId.Id;
this.ux.log(
msgs.getMessage('extension.map.previousEPN', [
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`'${element['DeveloperName']}'`,
'because it was for the same EPN in this webstore',
])
);
forceDataRecordDelete('StoreIntegratedService', deletedId, this.org.getUsername(), 'pipe');
}
}
}
}

0 comments on commit cac3a9a

Please sign in to comment.