Files
reiverr/backend/src/user/user.providers.ts
2024-03-26 00:44:28 +02:00

14 lines
367 B
TypeScript

import { DATA_SOURCE } from 'src/database/database.providers';
import { DataSource } from 'typeorm';
import { User } from './user.entity';
export const USER_REPOSITORY = 'USER_REPOSITORY';
export const userProviders = [
{
provide: USER_REPOSITORY,
useFactory: (dataSource: DataSource) => dataSource.getRepository(User),
inject: [DATA_SOURCE],
},
];