Skip to content

Commit

Permalink
Fix affiliate API endpoint (get feature promo) error
Browse files Browse the repository at this point in the history
  • Loading branch information
moh3a committed Oct 20, 2023
1 parent e55b6b0 commit 4add168
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ae_sdk

## 0.4.15

### Patch Changes

- Fix affiliate API endpoint (get feature promo) error

## 0.4.14

### Patch Changes
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": "ae_sdk",
"version": "0.4.14",
"version": "0.4.15",
"description": "A simple SDK for Aliexpress (dropshipping and affiliate) APIs.",
"private": false,
"main": "./dist/index.js",
Expand Down
6 changes: 4 additions & 2 deletions src/types/affiliate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export interface Affiliate_Featuredpromo_Details {

export interface Affiliate_Featuredpromo_Info {
current_record_count: number;
promos: Affiliate_Featuredpromo_Details;
promos: Affiliate_Featuredpromo_Details[];
}

export interface Affiliate_Featuredpromo_Info_Response {
Expand All @@ -323,7 +323,9 @@ export interface Affiliate_Featuredpromo_Info_Response {
}

export interface Affiliate_Featuredpromo_Info_Result {
aliexpress_affiliate_featuredpromo_get_response: Affiliate_Featuredpromo_Info_Response;
aliexpress_affiliate_featuredpromo_get_response: {
resp_result: Affiliate_Featuredpromo_Info_Response;
};
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/utils/affiliate_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ export class AffiliateClient extends AESystemClient {
);
if (response.ok) {
let data =
response.data.aliexpress_affiliate_featuredpromo_get_response.result
.promos;
if ((data as any).promo) {
data = (data as any).promo;
response.data.aliexpress_affiliate_featuredpromo_get_response
.resp_result.result;
if ((data.promos as any).promo) {
data.promos = (data.promos as any).promo;
}
}
return response;
Expand Down

0 comments on commit 4add168

Please sign in to comment.