Skip to content

Commit

Permalink
fix: location put 메서드 버그 수정 (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvalentine6 committed Nov 9, 2023
2 parents deb4ef7 + 229ae8f commit 9ef6fee
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/fe-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ env:
CONTAINER_NAME: web
REACT_APP_CHAT_WEBSOCKET_URL: ${{ secrets.REACT_APP_CHAT_WEBSOCKET_URL }}
REACT_APP_OAUTH_CLIENT_ID_DEV: ${{ secrets.REACT_APP_OAUTH_CLIENT_ID_DEV }}
REACT_APP_OAUTH_CLIENT_ID_PROD: ${{secrets.REACT_APP_OAUTH_CLIENT_ID_PROD}}
REACT_APP_PROD_API_URL: ${{secrets.REACT_APP_PROD_API_URL}}
REACT_APP_PROD_URL: ${{secrets.REACT_APP_PROD_URL}}
REACT_APP_OAUTH_CLIENT_ID_PROD: ${{ secrets.REACT_APP_OAUTH_CLIENT_ID_PROD }}
REACT_APP_PROD_API_URL: ${{ secrets.REACT_APP_PROD_API_URL }}
REACT_APP_PROD_URL: ${{ secrets.REACT_APP_PROD_URL }}

jobs:
deploy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,15 @@ private static String buildLocationName(Location location) {
.append(location.getTown());
return stringBuilder.toString();
}

@Override
public String toString() {
return "LocationDto{" +
"locationIdx=" + locationIdx +
", locationName='" + locationName + '\'' +
", city='" + city + '\'' +
", district='" + district + '\'' +
", town='" + town + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@
@NoArgsConstructor
public class MainSubDto {

private LocationDto main;
private LocationDto sub;
private Long main;
private Long sub;

@Override
public String toString() {
return "MainSubDto{" +
"main=" + main +
", sub=" + sub +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,12 @@ public MainSubTownDto updateMainSubLocation(Long memberIdx, MainSubDto mainSubDt
.orElseThrow(() -> new RestApiException(NO_EXISTING_MEMBER));

Location newSubLocation = null;
log.info("mainSubDto : " + mainSubDto.toString());

Location newMainLocation = locationRepository.findById(mainSubDto.getMain().getLocationIdx())
Location newMainLocation = locationRepository.findById(mainSubDto.getMain())
.orElseThrow(IllegalArgumentException::new);
if (mainSubDto.getSub() != null) {
newSubLocation = locationRepository.findById(mainSubDto.getSub().getLocationIdx())
newSubLocation = locationRepository.findById(mainSubDto.getSub())
.orElseThrow(IllegalArgumentException::new);
}
member.updateLocations(newMainLocation, newSubLocation);
Expand Down
2 changes: 1 addition & 1 deletion be/src/main/resources/data.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
USE `second-hand`
USE `second-hand`;

SET
foreign_key_checks = 0;
Expand Down

0 comments on commit 9ef6fee

Please sign in to comment.