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 Korsholm
2022-07-26 11:59:11 +00:00
committed by GitHub
co-authored by Oliver Windall Juhl
parent e51fdd3304
commit 0e0b131488
2 changed files with 11 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---
Expand store result to include default sales channel
@@ -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[]