fix(admin-ui): ensure that sales channel names are always an array (#4049)

This commit is contained in:
Riqwan Thamir
2023-05-09 12:25:43 +02:00
committed by GitHub
parent 2829537592
commit aa74ebb181
2 changed files with 9 additions and 4 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/admin-ui": patch
---
fix(admin-ui): ensure that sales channel names are always an array

View File

@@ -27,11 +27,11 @@ const useProductTableColumn = ({ setTileView, setListView, showList }) => {
const { store } = useAdminStore()
const getProductSalesChannels = (salesChannels) => {
;(salesChannels || []).sort(
defaultChannelsSorter(store?.default_sales_channel_id || "")
)
const salesChannelsNames = (salesChannels || [])
.sort(defaultChannelsSorter(store?.default_sales_channel_id || ""))
.map((sc) => sc.name)
return <DelimitedList list={salesChannels.map((sc) => sc.name)} />
return <DelimitedList list={salesChannelsNames} />
}
const columns = useMemo(