Skip to content

Commit

Permalink
Merge pull request #66 from uniquelyparticular/fix/api-version
Browse files Browse the repository at this point in the history
fix: updated to not add slash to api_version
  • Loading branch information
agrohs authored Aug 11, 2020
2 parents efed86d + 03177a0 commit 25c2ef3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ export class createClient {
}
} = this;

const version: string = api_version ? `${api_version}/` : '';
const storeCode: string = store_code ? `${store_code}/` : '';
const uri: string = `${store_url}/index.php/${storeCode}${removeLeadingSlash(
path
)}`;
// console.log('uri', uri);

const customHeaders = {
...classHeaders,
Expand All @@ -53,7 +51,7 @@ export class createClient {
authorization: `Token token="${this.access_token}"`,
'X-API-KEY': this.access_token,
'X-MAGENTO-M1-SDK-LANGUAGE': 'JS-REQUEST',
...(version && { 'X-API-VERSION': version }),
...(api_version && { 'X-API-VERSION': api_version }),
...(application && { 'X-MAGENTO-M1-APPLICATION': application }),
...(currency && { 'X-MAGENTO-M1-CURRENCY': currency }),
...customHeaders
Expand Down

0 comments on commit 25c2ef3

Please sign in to comment.