feat(region): Add admin region get + list endpoints (#6322)

**What**
Add `GET /admin/regions`
Add `GET /admin/regions/:id`

Blocked by #6320 

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
This commit is contained in:
Oli Juhl
2024-02-11 17:13:49 +00:00
committed by GitHub
co-authored by Adrien de Peretti
parent b91a1ca5b8
commit 95d0e58d31
28 changed files with 566 additions and 87 deletions
@@ -16,7 +16,8 @@ import { asFunction, asValue } from "awilix"
export async function loadInternalModule(
container: MedusaContainer,
resolution: ModuleResolution,
logger: Logger
logger: Logger,
migrationOnly?: boolean
): Promise<{ error?: Error } | void> {
const registrationName = resolution.definition.registrationName
@@ -64,6 +65,17 @@ export async function loadInternalModule(
}
}
if (migrationOnly) {
// Partially loaded module, only register the service __joinerConfig function to be able to resolve it later
const moduleService = {
__joinerConfig: loadedModule.service.prototype.__joinerConfig,
}
container.register({
[registrationName]: asValue(moduleService),
})
return
}
const localContainer = createMedusaContainer()
const dependencies = resolution?.dependencies ?? []