Skip to content

Commit ae637bd

Browse files
authored
fix: await useFactory resolution when registering Mikro ORM with forRootAsync (#166)
1 parent 8b0b190 commit ae637bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mikro-orm.providers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export function createMikroOrmAsyncOptionsProvider(options: MikroOrmModuleAsyncO
5757
if (options.useFactory) {
5858
return {
5959
provide: MIKRO_ORM_MODULE_OPTIONS,
60-
useFactory: (...args: any[]) => {
61-
const factoryOptions = options.useFactory!(...args);
60+
useFactory: async (...args: any[]) => {
61+
const factoryOptions = await options.useFactory!(...args);
6262
return options.contextName
6363
? { contextName: options.contextName, ...factoryOptions }
6464
: factoryOptions;

0 commit comments

Comments
 (0)