Files
reiverr/backend/src/users/user.providers.ts
2025-02-11 02:40:41 +02:00

14 lines
366 B
TypeScript

import { DataSource } from 'typeorm';
import { DATA_SOURCE } from '../database/database.providers';
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],
},
];