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:
co-authored by
Oliver Windall Juhl
parent
e51fdd3304
commit
0e0b131488
@@ -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 =
|
const fulfillmentProviderService: FulfillmentProviderService =
|
||||||
req.scope.resolve("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({
|
const data = (await storeService.retrieve({
|
||||||
relations: ["currencies", "default_currency"],
|
relations,
|
||||||
})) as Store & {
|
})) as Store & {
|
||||||
payment_providers: PaymentProvider[]
|
payment_providers: PaymentProvider[]
|
||||||
fulfillment_providers: FulfillmentProvider[]
|
fulfillment_providers: FulfillmentProvider[]
|
||||||
|
|||||||
Reference in New Issue
Block a user