Skip to content

Commit

Permalink
Country entity - Default export added
Browse files Browse the repository at this point in the history
  • Loading branch information
Disura-Randunu committed Sep 22, 2024
1 parent d9d5482 commit 22d173f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/controllers/country.controller.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Request, Response } from 'express'
import type { ApiResponse } from '../types'
import { type Country } from '../entities/country.entity'
import type Country from '../entities/country.entity'
import { getAllCountries } from '../services/country.service'

export const getCountries = async (
Expand Down
2 changes: 2 additions & 0 deletions src/entities/country.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ export class Country extends BaseEntity {
this.name = name
}
}

export default Country
2 changes: 1 addition & 1 deletion src/services/country.service.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dataSource } from '../configs/dbConfig'
import { type Country } from '../entities/country.entity'
import type Country from '../entities/country.entity'
import { getAllCountries } from './country.service'

jest.mock('../configs/dbConfig', () => ({
Expand Down
2 changes: 1 addition & 1 deletion src/services/country.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dataSource } from '../configs/dbConfig'
import { Country } from '../entities/country.entity'
import Country from '../entities/country.entity'

export const getAllCountries = async (): Promise<Country[] | null> => {
const countryRepository = dataSource.getRepository(Country)
Expand Down

0 comments on commit 22d173f

Please sign in to comment.