feat: Cart SalesChannel link + clean-up (#6418)
This commit is contained in:
1 parent
1df14de183
commit
1ba35b02dd
29 files changed
+276
-919
No files matched your search
@@ -1,15 +1,16 @@
|
||||
import { DALUtils, generateEntityId } from "@medusajs/utils"
|
||||
|
||||
import { DAL } from "@medusajs/types"
|
||||
import {
|
||||
BeforeCreate,
|
||||
Entity,
|
||||
Filter,
|
||||
Index,
|
||||
OnInit,
|
||||
OptionalProps,
|
||||
PrimaryKey,
|
||||
Property,
|
||||
} from "@mikro-orm/core"
|
||||
import { DAL } from "@medusajs/types"
|
||||
|
||||
type SalesChannelOptionalProps = "is_disabled" | DAL.EntityDateColumns
|
||||
|
||||
@@ -54,7 +55,7 @@ export default class SalesChannel {
|
||||
this.id = generateEntityId(this.id, "sc")
|
||||
}
|
||||
|
||||
@BeforeCreate()
|
||||
@OnInit()
|
||||
onInit() {
|
||||
this.id = generateEntityId(this.id, "sc")
|
||||
}
|
||||
|
||||
@@ -9,11 +9,7 @@ import {
|
||||
SalesChannelDTO,
|
||||
UpdateSalesChannelDTO,
|
||||
} from "@medusajs/types"
|
||||
import {
|
||||
InjectTransactionManager,
|
||||
MedusaContext,
|
||||
ModulesSdkUtils,
|
||||
} from "@medusajs/utils"
|
||||
import { MedusaContext, ModulesSdkUtils } from "@medusajs/utils"
|
||||
|
||||
import { SalesChannel } from "@models"
|
||||
|
||||
@@ -61,7 +57,6 @@ export default class SalesChannelModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<SalesChannelDTO>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
async create(
|
||||
data: CreateSalesChannelDTO | CreateSalesChannelDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
@@ -88,7 +83,6 @@ export default class SalesChannelModuleService<
|
||||
sharedContext?: Context
|
||||
): Promise<SalesChannelDTO>
|
||||
|
||||
@InjectTransactionManager("baseRepository_")
|
||||
async update(
|
||||
data: UpdateSalesChannelDTO | UpdateSalesChannelDTO[],
|
||||
@MedusaContext() sharedContext: Context = {}
|
||||
|
||||
Reference in new issue
Block a user