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

12 lines
317 B
TypeScript
Raw Normal View History

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