chore(): Reorganize modules (#7210)
**What** Move all modules to the modules directory
This commit is contained in:
committed by
GitHub
parent
7a351eef09
commit
4eae25e1ef
@@ -0,0 +1,22 @@
|
||||
import { Constructor, ILinkModule, ModuleJoinerConfig } from "@medusajs/types"
|
||||
import { LinkModuleService } from "@services"
|
||||
|
||||
export function getModuleService(
|
||||
joinerConfig: ModuleJoinerConfig
|
||||
): Constructor<ILinkModule> {
|
||||
const joinerConfig_ = JSON.parse(JSON.stringify(joinerConfig))
|
||||
delete joinerConfig_.databaseConfig
|
||||
return class LinkService extends LinkModuleService<unknown> {
|
||||
override __joinerConfig(): ModuleJoinerConfig {
|
||||
return joinerConfig_ as ModuleJoinerConfig
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function getReadOnlyModuleService(joinerConfig: ModuleJoinerConfig) {
|
||||
return class ReadOnlyLinkService {
|
||||
__joinerConfig(): ModuleJoinerConfig {
|
||||
return joinerConfig as ModuleJoinerConfig
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user