chore: Migrate modules to use the Module util (#7964)
**What** Apply the `Module` util to each module to handle the export and provide the linkable configuration object. - Most joiner config that does not have any special config are removed/cleaned up in favor of the autogenerated one or simpler one - linkable are now available in all modules - cleaned up the dependencies of the modules FIXES CORE-2410
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { ModuleExports } from "@medusajs/types"
|
||||
import { Module, Modules } from "@medusajs/utils"
|
||||
import { SalesChannelModuleService } from "@services"
|
||||
|
||||
const moduleDefinition: ModuleExports = {
|
||||
export default Module(Modules.SALES_CHANNEL, {
|
||||
service: SalesChannelModuleService,
|
||||
}
|
||||
export default moduleDefinition
|
||||
})
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
import { defineJoinerConfig, Modules } from "@medusajs/utils"
|
||||
|
||||
export const joinerConfig = defineJoinerConfig(Modules.SALES_CHANNEL)
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
FilterableSalesChannelProps,
|
||||
InternalModuleDeclaration,
|
||||
ISalesChannelModuleService,
|
||||
ModuleJoinerConfig,
|
||||
ModulesSdkTypes,
|
||||
SalesChannelDTO,
|
||||
UpdateSalesChannelDTO,
|
||||
@@ -22,7 +21,6 @@ import {
|
||||
|
||||
import { SalesChannel } from "@models"
|
||||
import { UpdateSalesChanneInput } from "@types"
|
||||
import { joinerConfig } from "../joiner-config"
|
||||
|
||||
type InjectedDependencies = {
|
||||
baseRepository: DAL.RepositoryService
|
||||
@@ -48,10 +46,6 @@ export default class SalesChannelModuleService
|
||||
this.salesChannelService_ = salesChannelService
|
||||
}
|
||||
|
||||
__joinerConfig(): ModuleJoinerConfig {
|
||||
return joinerConfig
|
||||
}
|
||||
|
||||
// @ts-expect-error
|
||||
async createSalesChannels(
|
||||
data: CreateSalesChannelDTO[],
|
||||
|
||||
Reference in New Issue
Block a user