feat(medusa): Prevent default channel from being deleted (#1835)
**What** Prevent the default channel from being deleted Fixes CORE-317
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { Connection } from "typeorm"
|
||||
import faker from "faker"
|
||||
import { SalesChannel } from "@medusajs/medusa"
|
||||
import faker from "faker"
|
||||
import { Connection } from "typeorm"
|
||||
|
||||
export type SalesChannelFactoryData = {
|
||||
name?: string
|
||||
description?: string
|
||||
is_disabled?: boolean
|
||||
id?: string
|
||||
}
|
||||
|
||||
export const simpleSalesChannelFactory = async (
|
||||
@@ -20,7 +21,7 @@ export const simpleSalesChannelFactory = async (
|
||||
const manager = connection.manager
|
||||
|
||||
const salesChannel = manager.create(SalesChannel, {
|
||||
id: `simple-id-${Math.random() * 1000}`,
|
||||
id: data.id ?? `simple-id-${Math.random() * 1000}`,
|
||||
name: data.name || faker.name.firstName(),
|
||||
description: data.description || faker.name.lastName(),
|
||||
is_disabled:
|
||||
|
||||
Reference in New Issue
Block a user