@bigcommerce/stencil-cli 7.4.1 → 7.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -208,11 +208,23 @@ async function getChannelActiveTheme({ accessToken, apiHost, storeHash, channelI
208
208
  */
209
209
  async function getStoreChannels({ accessToken, apiHost, storeHash }) {
210
210
  try {
211
- const response = await networkUtils.sendApiRequest({
211
+ const sitesResponse = await networkUtils.sendApiRequest({
212
212
  url: `${apiHost}/stores/${storeHash}/v3/sites`,
213
213
  accessToken,
214
214
  });
215
- return response.data.data;
215
+ const channelsResponse = await networkUtils.sendApiRequest({
216
+ url: `${apiHost}/stores/${storeHash}/v3/channels`,
217
+ accessToken,
218
+ });
219
+
220
+ const storefrontChannels = channelsResponse.data.data.filter(
221
+ (channel) => channel.type === 'storefront',
222
+ );
223
+
224
+ return sitesResponse.data.data.filter(
225
+ (site) =>
226
+ storefrontChannels.filter((channel) => channel.id === site.channel_id).length > 0,
227
+ );
216
228
  } catch (err) {
217
229
  throw new Error(`Could not fetch a list of the store channels: ${err.message}`);
218
230
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigcommerce/stencil-cli",
3
- "version": "7.4.1",
3
+ "version": "7.4.2",
4
4
  "description": "CLI tool to run BigCommerce Stores locally for theme development.",
5
5
  "main": "index.js",
6
6
  "engines": {