Skip to content

Commit f379194

Browse files
committed
Refactor pagination parameter validation in ViolationReportController to ensure default values are set correctly
1 parent 57cbe80 commit f379194

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/com/openelements/conduct/controller/ViolationReportController.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,10 @@ public ResponseEntity<PagedResponse<ViolationReportDto>> getReports(
3333
@RequestParam(required = false) ViolationState violationState,
3434
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate,
3535
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endDate) {
36-
37-
// Validate pagination parameters
36+
3837
if (page < 0) page = 0;
3938
if (size <= 0 || size > 100) size = 100;
40-
41-
// Pass null (or appropriate value) for the missing String parameter
39+
4240
PagedResponse<ViolationReportDto> response = violationReportService.getReports(
4341
page, size, sortBy, sortDir, violationState, null, startDate, endDate
4442
);

0 commit comments

Comments
 (0)