Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #100 from Mini-Team-6/feature/#93-accommodation-ex…
Browse files Browse the repository at this point in the history
…ception

Feat: 조회할 값이 없는 페이지 조회 시 204 에러처리
  • Loading branch information
yuhyun1 authored Nov 28, 2023
2 parents b2cdebb + 9d01579 commit c7e942d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import ybe.mini.travelserver.domain.accommodation.entity.Accommodation;
import ybe.mini.travelserver.domain.accommodation.entity.AreaCode;
import ybe.mini.travelserver.global.api.TourAPIService;
import ybe.mini.travelserver.global.exception.api.NoAccommodationsFromAPIException;

import java.util.Collections;
import java.util.List;


Expand All @@ -22,7 +22,9 @@ public List<AccommodationGetResponse> bringAccommodations(
int pageNo, int numOfRows,
String keyword, AreaCode areaCode
) {
if (pageNo <= 0) return Collections.emptyList();
if (pageNo <= 0) {
throw new NoAccommodationsFromAPIException();
}

String areaCodeString = (areaCode != null) ? String.valueOf(areaCode.getCode()) : null;

Expand Down

0 comments on commit c7e942d

Please sign in to comment.