Skip to content

Commit

Permalink
fix: update channel storefront set
Browse files Browse the repository at this point in the history
  • Loading branch information
b3aton committed Feb 3, 2023
1 parent 16e3f38 commit b581549
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apps/storefront/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default function App() {
BcToken,
role,
logo,
bcChannelId,
currentChannelId,
isAgenting,
quoteConfig,
storefrontConfig,
Expand Down Expand Up @@ -175,7 +175,7 @@ export default function App() {
await loginInfo()
}

setChannelStoreType(bcChannelId)
setChannelStoreType(currentChannelId)
await Promise.all([getQuoteConfig(), setStorefrontConfig()])

if (!customerId) await getCurrentCustomerInfo(dispatch)
Expand Down
4 changes: 2 additions & 2 deletions apps/storefront/src/components/B3StoreContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const B3StoreContainer = (props: B3StoreContainerProps) => {
const {
channelId,
channelLogo: logo,
b3ChannelId: bcChannelId,
b3ChannelId: b2bChannelId,
b2bEnabled: storeEnabled,
} = getCurrentStoreInfo((storeBasicInfo as StoreBasicInfo)?.storeSites || [])

Expand All @@ -64,7 +64,7 @@ export const B3StoreContainer = (props: B3StoreContainerProps) => {
logo,
storeEnabled,
currentChannelId: channelId,
bcChannelId,
b2bChannelId,
storeName: storeBasicInfo.storeName,
},
})
Expand Down
4 changes: 2 additions & 2 deletions apps/storefront/src/shared/global/context/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export interface GlobalState {
storeEnabled: boolean,
storeName: string,
currentChannelId: number,
bcChannelId: number,
b2bChannelId: number,
countriesList?: Country[],
productQuoteEnabled: boolean,
cartQuoteEnabled: boolean,
Expand Down Expand Up @@ -166,7 +166,7 @@ export const initState = {
storeEnabled: false,
storeName: '',
currentChannelId: 1,
bcChannelId: 1,
b2bChannelId: 1,
countriesList: [],
productQuoteEnabled: false,
cartQuoteEnabled: false,
Expand Down
4 changes: 2 additions & 2 deletions apps/storefront/src/shared/service/b2b/api/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export const uploadB2BFile = (data: UploadFileData) => {
return B3Request.fileUpload('/api/v2/media/upload', formData)
}

export const setChannelStoreType = (bcChannelId: number): CustomFieldItems => B3Request.put('/api/v2/store-configs/channel-storefront-type', RequestType.B2BRest, {
bcChannelId,
export const setChannelStoreType = (channelId: number): CustomFieldItems => B3Request.put('/api/v2/store-configs/channel-storefront-type', RequestType.B2BRest, {
bcChannelId: channelId,
storefrontType: 1,
storeHash,
})

0 comments on commit b581549

Please sign in to comment.