Feat(medusa): expand store result (#1884)

**What**
- include the default sales channel in the result of `get-store` if featureflag is set

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Philip KorsholmandOliver Windall Juhl authored and GitHub committed 2022-07-26 11:59:11 +00:00
1 parent e51fdd3304
commit 0e0b131488
2 files changed
+11 -1

No files matched your search

@@ -36,8 +36,13 @@ export default async (req, res) => {
const fulfillmentProviderService: FulfillmentProviderService =
req.scope.resolve("fulfillmentProviderService")
const relations = ["currencies", "default_currency"]
if (featureFlagRouter.isFeatureEnabled("sales_channels")) {
relations.push("default_sales_channel")
}
const data = (await storeService.retrieve({
relations: ["currencies", "default_currency"],
relations,
})) as Store & {
payment_providers: PaymentProvider[]
fulfillment_providers: FulfillmentProvider[]