Skip to content

Commit

Permalink
Fix ormconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
gyusang committed Sep 29, 2024
1 parent 19a9895 commit 0fa5181
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { DepartmentModule } from './department/department.module';
import { FirebaseModule } from './firebase/firebase.module';
import { getEnvFile } from './functions/custom-function';
import { NoticeModule } from './notice/notice.module';
import * as ormConfig from './ormconfig';
import ormConfig from './ormconfig';
import { UserModule } from './user/user.module';

@Module({
Expand Down
2 changes: 1 addition & 1 deletion src/datasource.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DataSource, DataSourceOptions } from 'typeorm';

import * as dataSourceOptions from './ormconfig.js';
import dataSourceOptions from './ormconfig.js';

export const dataSource = new DataSource(dataSourceOptions as DataSourceOptions);
10 changes: 5 additions & 5 deletions src/ormconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import * as path from 'path';
import { config } from 'dotenv';
import { DataSourceOptions } from 'typeorm';

import { Department, NoticeTag, Tag, UserTag } from './department/department.entity';
import { getEnvFile } from './functions/custom-function';
import { Notice, UserNotice, File } from './notice/notice.entity';
import { User } from './user/user.entity';
import { Department, NoticeTag, Tag, UserTag } from './department/department.entity.js';
import { getEnvFile } from './functions/custom-function.js';
import { Notice, UserNotice, File } from './notice/notice.entity.js';
import { User } from './user/user.entity.js';

const envFile = getEnvFile();
config({ path: path.resolve(process.cwd(), envFile) });
Expand All @@ -29,4 +29,4 @@ const ormConfig: DataSourceOptions = {
},
};

export = ormConfig;
export default ormConfig;

0 comments on commit 0fa5181

Please sign in to comment.