Skip to content

Commit

Permalink
fix(get-store-id): also sets channel ID on config
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 committed Jul 21, 2019
1 parent c5d8404 commit 2bf6f9e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/methods/get-store-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ const getStoreId = domain => {
// send request to Platform API
return apiPlatform(endpoint).then(({ data }) => {
// set Store IDs on config
_config.set('store_id', data.store_id)
_config.set('store_object_id', data.store_object_id)
;[ 'store_id', 'store_object_id', 'channel_id' ].forEach(prop => _config.set(prop, data[prop]))

// check for default sales channel language
const lang = data.default_lang
Expand Down Expand Up @@ -48,7 +47,14 @@ const getStoreId = domain => {
*
* @example
// TODO
ecomClient.getStoreId('shop-plus.e-com.plus')
.then(storeId => console.log(storeId))
.catch(error => {
console.error(error)
if (error.response) {
console.log(error.response)
}
})
*/

Expand Down

0 comments on commit 2bf6f9e

Please sign in to comment.