chore(feature-flags): Sales Channels enabled by default (#2966)

This commit is contained in:
Oliver Windall Juhl
2023-01-10 16:45:23 +00:00
committed by GitHub
parent cac81749ea
commit 3308766389
34 changed files with 372 additions and 498 deletions
@@ -1,6 +1,6 @@
import { Connection } from "typeorm"
import { SalesChannel, Store } from "@medusajs/medusa"
import faker from "faker"
import { Store } from "@medusajs/medusa"
import { Connection } from "typeorm"
export type StoreFactoryData = {
swap_link_template?: string
@@ -20,5 +20,14 @@ export const simpleStoreFactory = async (
store.swap_link_template = data.swap_link_template ?? "something/{cart_id}"
return await manager.save(store)
await manager.insert(SalesChannel, {
id: "test-channel",
name: "Default"
})
const storeToSave = await manager.save(store)
await manager.query(`update store set default_sales_channel_id = 'test-channel' where id = '${storeToSave!.id}'`)
return storeToSave!
}