Skip to content

Commit

Permalink
Refactor to mapNodeToChoice
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekChoinski committed Jan 12, 2021
1 parent 95df27a commit 4f58c2e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/channels/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { RequireOnlyOne } from "@saleor/misc";
import { ProductDetails_product } from "@saleor/products/types/ProductDetails";
import { ProductVariantDetails_productVariant } from "@saleor/products/types/ProductVariantDetails";
import { ShippingZone_shippingZone_shippingMethods_channelListings } from "@saleor/shipping/types/ShippingZone";
import { mapNodeToChoice } from "@saleor/utils/maps";
import uniqBy from "lodash-es/uniqBy";

export interface Channel {
Expand Down Expand Up @@ -311,14 +312,11 @@ export const getChannelsCurrencyChoices = (
channelsList: Channels_channels[]
) =>
id
? channelsList
?.filter(
? mapNodeToChoice(
channelsList?.filter(
channel =>
channel.id !== id &&
channel.currencyCode === selectedChannel?.currencyCode
)
.map(channel => ({
label: channel.name,
value: channel.id
}))
)
: [];

0 comments on commit 4f58c2e

Please sign in to comment.