Skip to content

Commit

Permalink
fix: 내용이 없는 페이지 요청에 대해 빈 배열 응답하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Miensoap committed Nov 11, 2024
1 parent 6a09b32 commit f415ec8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions backend/src/place/place.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { PlaceSearchResponse } from './dto/PlaceSearchResponse';

@Injectable()
export class PlaceService {
constructor(private readonly placeRepository: PlaceRepository) {}
constructor(private readonly placeRepository: PlaceRepository) {

Check failure on line 10 in backend/src/place/place.service.ts

View workflow job for this annotation

GitHub Actions / Lint, Build and Test (backend)

Delete `⏎··`
}

async addPlace(createPlaceRequest: CreatePlaceRequest) {
const { googlePlaceId } = createPlaceRequest;
Expand All @@ -23,15 +24,12 @@ export class PlaceService {
async getPlaces(query?: string, page: number = 1, pageSize: number = 10) {
const result = query
? await this.placeRepository.searchByNameOrAddressQuery(
query,
page,
pageSize,
)
query,

Check failure on line 27 in backend/src/place/place.service.ts

View workflow job for this annotation

GitHub Actions / Lint, Build and Test (backend)

Insert `··`
page,

Check failure on line 28 in backend/src/place/place.service.ts

View workflow job for this annotation

GitHub Actions / Lint, Build and Test (backend)

Insert `··`
pageSize,

Check failure on line 29 in backend/src/place/place.service.ts

View workflow job for this annotation

GitHub Actions / Lint, Build and Test (backend)

Insert `··`
)

Check failure on line 30 in backend/src/place/place.service.ts

View workflow job for this annotation

GitHub Actions / Lint, Build and Test (backend)

Insert `··`
: await this.placeRepository.findAll(page, pageSize);

if (!result.length) {
throw new PlaceNotFoundException();
}
return result.map(PlaceSearchResponse.from);
}

Expand Down

0 comments on commit f415ec8

Please sign in to comment.