Skip to content
This repository was archived by the owner on Apr 7, 2023. It is now read-only.

Commit c389c14

Browse files
dbates-salesforceGitHub Enterprise
authored andcommitted
Fix for W-9099136 (#3)
* initial commit to github initial commit to github * initial commit to github initial commit to github * Update products.ts * Add files via upload * Update 1commerce.json * Fix for W-9099136 Changes to the inputRepresentation names, need to update SFDX Plugin W-9099136 https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07AH000000A8lrYAC/view * Fix for W-9099136 Changes to the inputRepresentation names, need to update SFDX Plugin W-9099136 https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07AH000000A8lrYAC/view * Changed back
1 parent 52ab120 commit c389c14

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

messages/1commerce.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"nameFlagDescription": "name to print",
44
"forceFlagDescription": "example boolean flag",
55
"errorNoOrgResults": "No results found for the org '%s'.",
6-
"dataIdDescription": "ID of a file in FFX; CSV only for 230; JSON and XML (?) planned for the future. To be imported into the store",
7-
"webstoreIdDescription": "the ID of the webstore to import to, will fetch/create the defaults associated with this webstore if needed. This is or the name is required.",
8-
"nameDescription": "The name of the webstore to import to that was created. This or the webstoreId is required"
6+
"contentVersionIdDescription":"ID of a file in FFX; CSV only for 230; JSON and XML (?) planned for the future. To be imported into the store",
7+
"webstoreIdDescription":"the ID of the webstore to import to, will fetch/create the defaults associated with this webstore if needed. This is or the name is required.",
8+
"nameDescription":"The name of the webstore to import to that was created. This or the webstoreId is required"
99
}

src/commands/1commerce/import/products.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ export class ImportProducts extends SfdxCommand {
2727
public static examples = [`$ sfdx ${CMD} -d 00Dxx0000000000 -w 00Dxx0000000000`];
2828

2929
protected static flagsConfig = {
30-
dataid: flags.string({
30+
contentversionid: flags.string({
3131
char: 'd',
3232
required: true,
33-
description: messages.getMessage('dataIdDescription'),
33+
description: messages.getMessage('contentVersionIdDescription'),
3434
}),
3535
webstoreid: flags.string({
3636
char: 'w',
@@ -66,9 +66,9 @@ export class ImportProducts extends SfdxCommand {
6666
method: 'POST',
6767
url: `${conn.baseUrl()}${DEFAULT_PATH}`,
6868
body: `{
69-
"dataId": "${this.flags.dataid}",
69+
"contentVersionId": "${this.flags.contentversionid}",
7070
"webstoreId": "${webStoreId}"
71-
}`,
71+
}`,
7272
headers: {
7373
key: 'Content-Type',
7474
type: 'text',

test/commands/1commerce/import/products.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
/*
23
* Copyright (c) 2020, salesforce.com, inc.
34
* All rights reserved.
@@ -13,7 +14,7 @@ const ID_RESP = {
1314
{
1415
catalogId: '0ABC012',
1516
categoriesCreated: 0,
16-
dataId: '00CBA321',
17+
contentversionid: '00CBA321',
1718
endTime: 1611937216089,
1819
entitlementId: '0ABC789',
1920
numberError: 0,
@@ -69,7 +70,7 @@ describe.skip('1commerce:import:products', () => {
6970
])
7071
.it('runs 1commerce:import:products --targetusername [email protected] --name TestStore', (ctx) => {
7172
expect(ctx.stdout, ctx.stderr).to.contain(
72-
'{"catalogId":"0ABC012","categoriesCreated":0,"dataId":"00CBA321","endTime":1611937216089,"entitlementId":"0ABC789","numberError":0,"numberSuccess":2,"numberToProcess":2,"pricebookId":"0ABC456","productsCreated":0,"productsUpdated":2,"sampleDataEnum":null,"startTime":1611937212942,"startedBy":"00ABCSTME","status":"COMPLETED","webstoreId":"0ABC123"}'
73+
'{"catalogId":"0ABC012","categoriesCreated":0,"contentversionid":"00CBA321","endTime":1611937216089,"entitlementId":"0ABC789","numberError":0,"numberSuccess":2,"numberToProcess":2,"pricebookId":"0ABC456","productsCreated":0,"productsUpdated":2,"sampleDataEnum":null,"startTime":1611937212942,"startedBy":"00ABCSTME","status":"COMPLETED","webstoreId":"0ABC123"}'
7374
);
7475
});
75-
});
76+
});

0 commit comments

Comments
 (0)