From 72c8ba6797f4f74ac267cadbff122309f190f559 Mon Sep 17 00:00:00 2001 From: daeun084 <030804jk@naver.com> Date: Sun, 8 Sep 2024 12:13:22 +0900 Subject: [PATCH] !hotfix: inquiry, proposal status --- src/main/java/FITPET/dev/converter/InquiryConverter.java | 7 +++---- src/main/java/FITPET/dev/converter/ProposalConverter.java | 5 +++-- src/main/java/FITPET/dev/service/ProposalService.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/FITPET/dev/converter/InquiryConverter.java b/src/main/java/FITPET/dev/converter/InquiryConverter.java index 48bb16f..ac10992 100644 --- a/src/main/java/FITPET/dev/converter/InquiryConverter.java +++ b/src/main/java/FITPET/dev/converter/InquiryConverter.java @@ -2,10 +2,8 @@ import FITPET.dev.common.enums.InquiryStatus; import FITPET.dev.dto.response.InquiryResponse; -import FITPET.dev.dto.response.ProposalResponse; import FITPET.dev.entity.Inquiry; -import FITPET.dev.entity.Proposal; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.List; @@ -37,7 +35,7 @@ public static InquiryResponse.InquiryDto toInquiryDto(Inquiry inquiry){ .email(inquiry.getEmail()) .phoneNum(inquiry.getPhoneNum()) .comment(inquiry.getComment()) - .status(inquiry.getStatus().getLabel()) + .status(inquiry.getStatus().toString()) .build(); } @@ -61,7 +59,8 @@ public static InquiryResponse.InquiryPageDto toInquiryPageDto(Page page .currentPage(page.getNumber() + 1) .pageSize(page.getSize()) .numberOfElement(page.getNumberOfElements()) - .totalElements((int) page.getTotalElements()) .totalPage(page.getTotalPages()) + .totalElements((int) page.getTotalElements()) + .totalPage(page.getTotalPages()) .build(); } diff --git a/src/main/java/FITPET/dev/converter/ProposalConverter.java b/src/main/java/FITPET/dev/converter/ProposalConverter.java index 1367a62..31052fd 100644 --- a/src/main/java/FITPET/dev/converter/ProposalConverter.java +++ b/src/main/java/FITPET/dev/converter/ProposalConverter.java @@ -34,7 +34,7 @@ public static ProposalResponse.ProposalDto toProposalDto(Proposal proposal){ .email(proposal.getEmail()) .phoneNum(proposal.getPhoneNum()) .comment(proposal.getComment()) - .status(proposal.getStatus().getLabel()) + .status(proposal.getStatus().toString()) .build(); } @@ -58,7 +58,8 @@ public static ProposalResponse.ProposalPageDto toProposalPageDto(Page .currentPage(page.getNumber() + 1) .pageSize(page.getSize()) .numberOfElement(page.getNumberOfElements()) - .totalElements((int) page.getTotalElements()) .totalPage(page.getTotalPages()) + .totalElements((int) page.getTotalElements()) + .totalPage(page.getTotalPages()) .build(); } } diff --git a/src/main/java/FITPET/dev/service/ProposalService.java b/src/main/java/FITPET/dev/service/ProposalService.java index 76304e2..b8eee6f 100644 --- a/src/main/java/FITPET/dev/service/ProposalService.java +++ b/src/main/java/FITPET/dev/service/ProposalService.java @@ -104,7 +104,7 @@ public ProposalResponse.ProposalDto patchProposalStatus(Long proposalId, Proposa @Transactional public void deleteProposal(Long proposalId) { Proposal proposal = findProposalById(proposalId); - proposalRepository.save(proposal); + proposalRepository.delete(proposal); } private Page getProposalListByStatusBetweenDate(LocalDateTime start, LocalDateTime end, ProposalStatus proposalStatus, Pageable pageable) {