12 lines
368 B
TypeScript
12 lines
368 B
TypeScript
import { FactoryProvider } from '@nestjs/common';
|
|
import { DataSource, Repository } from 'typeorm';
|
|
import { Upload } from './upload.entity';
|
|
|
|
export const uploadProviders = [
|
|
{
|
|
provide: 'UPLOAD_REPOSITORY',
|
|
useFactory: (dataSource: DataSource) => dataSource.getRepository(Upload),
|
|
inject: ['DATA_SOURCE'],
|
|
} as FactoryProvider<Repository<Upload>>,
|
|
];
|