icynet-auth-server/src/modules/objects/privilege/privilege.providers.ts

12 lines
386 B
TypeScript

import { FactoryProvider } from '@nestjs/common';
import { DataSource, Repository } from 'typeorm';
import { Privilege } from './privilege.entity';
export const privilegeProviders = [
{
provide: 'PRIVILEGE_REPOSITORY',
useFactory: (dataSource: DataSource) => dataSource.getRepository(Privilege),
inject: ['DATA_SOURCE'],
} as FactoryProvider<Repository<Privilege>>,
];