Skip to content

Commit

Permalink
Merge pull request #96 from Hooking-CEOS/feature/copy
Browse files Browse the repository at this point in the history
Feature/copy
  • Loading branch information
JiwonKim08 authored Jul 29, 2023
2 parents 002b74d + dc71e2f commit 1e56422
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
targetUrl = "http://localhost:3000/oath-processor"; // 로컬 환경
} else if (referer != null && referer.startsWith("https://hooking.me/") && host.equals("hooking.shop")) {
targetUrl = "https://hooking.me/oath-processor"; // 실배포 환경

}
else {
// 기본적으로 로컬 개발 환경으로 설정
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,18 @@ public ResponseEntity<List<CopyRes>> searchFilterCard(HttpServletRequest httpReq


// 카피라이팅 스크랩 취소 (soft delete)
@PostMapping ("/scrap/cancel")
public ResponseEntity<String> cancelScrap(HttpServletRequest httpRequest, @RequestBody CopyReq copyReq){
@PostMapping ("/scrap/cancle")
public ResponseEntity<HttpRes<String>> cancelScrap(HttpServletRequest httpRequest, @RequestBody CopyReq copyReq){
User user = jwtTokenProvider.getUserInfoByToken(httpRequest);
Long cardId = copyReq.getCardId();
Card card = cardRepository.findCardById(cardId);
boolean is_canceled = copyService.cancelScrap(user, card);
if(is_canceled){
return ResponseEntity.status(HttpStatus.OK).body("삭제되었습니다.");
return ResponseEntity.ok(new HttpRes<>("해당 스크랩을 삭제했습니다."));
}
else{
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("스크랩 정보가 유효하지 않습니다.");
String errorMessage = "스크랩 정보가 유효하지 않습니다.";
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new HttpRes<>(HttpStatus.BAD_REQUEST.value(), errorMessage));
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface ScrapRepository extends JpaRepository<Scrap, Long> {
@Override
List<Scrap> findAll();

List<Scrap> findScrapByUser(User user);
List<Scrap> findScrapByUser(User user); //여기서 최신순으로 가져오게

List<Scrap> findByCardId(Long id); // 카드 식별번호로 스크랩 객체 찾기

Expand Down

0 comments on commit 1e56422

Please sign in to comment.