chore(feature-flags): Sales Channels enabled by default (#2966)
This commit is contained in:
@@ -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!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user