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

12 lines
325 B
TypeScript
Raw Normal View History

import { Provider } from '@nestjs/common';
2022-03-09 18:37:04 +00:00
import { Connection } from 'typeorm';
import { User } from './user.entity';
export const userProviders: Provider<any>[] = [
2022-03-09 18:37:04 +00:00
{
provide: 'USER_REPOSITORY',
useFactory: (connection: Connection) => connection.getRepository(User),
inject: ['DATABASE_CONNECTION'],
},
];