fix: ReportRepository method name mismatch (targetDate)

This commit is contained in:
pray4skylark
2026-06-08 10:31:50 +09:00
parent 03d0d1e43d
commit 15b73e7bc0
2 changed files with 8 additions and 2 deletions
@@ -64,7 +64,12 @@ public class ReportService {
public Page<WorkReportResponse> findByUserId(Long userId, ReportStatus status, String type, LocalDate targetDate, Pageable pageable) {
ReportType reportType = type != null ? ReportType.valueOf(type) : null;
Page<Report> reports = reportRepository.findByUser_EmpIdAndStatusAndReportType(userId, status, reportType, targetDate, pageable);
Page<Report> reports;
if (targetDate != null) {
reports = reportRepository.findByUser_EmpIdAndStatusAndReportTypeAndTargetDate(userId, status, reportType, targetDate, pageable);
} else {
reports = reportRepository.findByUser_EmpIdAndStatusAndReportType(userId, status, reportType, pageable);
}
return reports.map(this::toWorkReportResponse);
}