Skip to content

Commit

Permalink
!hotfix: inquiry, proposal status
Browse files Browse the repository at this point in the history
  • Loading branch information
daeun084 committed Sep 8, 2024
1 parent 769c86f commit 72c8ba6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/main/java/FITPET/dev/converter/InquiryConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}

Expand All @@ -61,7 +59,8 @@ public static InquiryResponse.InquiryPageDto toInquiryPageDto(Page<Inquiry> 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();
}

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/FITPET/dev/converter/ProposalConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -58,7 +58,8 @@ public static ProposalResponse.ProposalPageDto toProposalPageDto(Page<Proposal>
.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();
}
}
2 changes: 1 addition & 1 deletion src/main/java/FITPET/dev/service/ProposalService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Proposal> getProposalListByStatusBetweenDate(LocalDateTime start, LocalDateTime end, ProposalStatus proposalStatus, Pageable pageable) {
Expand Down

0 comments on commit 72c8ba6

Please sign in to comment.