Skip to content

Commit

Permalink
axios upgraded
Browse files Browse the repository at this point in the history
  • Loading branch information
shafeeqd959 committed Aug 19, 2024
1 parent 7216afb commit a311b2e
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 36 deletions.
96 changes: 72 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/contentstack-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@contentstack/management": "~1.17.0",
"@contentstack/marketplace-sdk": "^1.2.1",
"@oclif/core": "^3.26.5",
"axios": "^1.6.4",
"axios": "^1.7.4",
"chalk": "^4.0.0",
"cli-cursor": "^3.1.0",
"cli-table": "^0.3.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,21 @@ export class PersonalizationAdapter<T> extends AdapterHelper<T, HttpClient> impl
}

async getVariantGroup(input: GetVariantGroupInput): Promise<VariantGroupStruct | void> {
const getVariantGroupEndPoint = `/variant_groups`;
const data = await this.cmaAPIClient
.queryParams({ experience_uid: input.experienceUid })
.get(getVariantGroupEndPoint);
return this.handleVariantAPIRes(data) as VariantGroupStruct;
if (this.cmaAPIClient) {
const getVariantGroupEndPoint = `/variant_groups`;
const data = await this.cmaAPIClient
.queryParams({ experience_uid: input.experienceUid })
.get(getVariantGroupEndPoint);
return this.handleVariantAPIRes(data) as VariantGroupStruct;
}
}

async updateVariantGroup(input: VariantGroup): Promise<VariantGroup | void> {
const updateVariantGroupEndPoint = `/variant_groups/${input.uid}`;
const data = await this.cmaAPIClient.put(updateVariantGroupEndPoint, input);
return this.handleVariantAPIRes(data) as VariantGroup;
if (this.cmaAPIClient) {
const updateVariantGroupEndPoint = `/variant_groups/${input.uid}`;
const data = await this.cmaAPIClient.put(updateVariantGroupEndPoint, input);
return this.handleVariantAPIRes(data) as VariantGroup;
}
}

async getEvents(): Promise<EventStruct[] | void> {
Expand Down
16 changes: 13 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a311b2e

Please sign in to comment.