2022-11-28 15:04:32 +01:00
|
|
|
import { Global, Module } from "@nestjs/common";
|
2022-12-30 14:40:23 +01:00
|
|
|
import { EmailModule } from "src/email/email.module";
|
2022-11-28 15:04:32 +01:00
|
|
|
import { PrismaService } from "src/prisma/prisma.service";
|
|
|
|
import { ConfigController } from "./config.controller";
|
|
|
|
import { ConfigService } from "./config.service";
|
|
|
|
|
|
|
|
@Global()
|
|
|
|
@Module({
|
2022-12-30 14:40:23 +01:00
|
|
|
imports: [EmailModule],
|
2022-11-28 15:04:32 +01:00
|
|
|
providers: [
|
|
|
|
{
|
|
|
|
provide: "CONFIG_VARIABLES",
|
|
|
|
useFactory: async (prisma: PrismaService) => {
|
|
|
|
return await prisma.config.findMany();
|
|
|
|
},
|
|
|
|
inject: [PrismaService],
|
|
|
|
},
|
|
|
|
ConfigService,
|
|
|
|
],
|
|
|
|
controllers: [ConfigController],
|
|
|
|
exports: [ConfigService],
|
|
|
|
})
|
|
|
|
export class ConfigModule {}
|