Skip to content

Commit

Permalink
updated timereport in controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Junotas committed Jul 17, 2024
1 parent a280940 commit 7d686d0
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public ResponseEntity<TimeReport> postNewTimeReport(@RequestBody TimeReportDTO t
}

@PatchMapping("/{id}")
public ResponseEntity<TimeReport> updateTimeReport(@PathVariable Long id, @RequestBody TimeReportDateUpdateDTO updateDTO) {
TimeReport updatedTimeReport = timeReportService.updateTimeReport(id, updateDTO.getStartTime(), updateDTO.getEndTime());
return ResponseEntity.ok(updatedTimeReport);
}

@PatchMapping("/approve/{id}")
public ResponseEntity<TimeReport> approveTimeReport(@PathVariable Long id, @RequestBody TimeReportDateUpdateDTO updateDTO) {
TimeReport updatedTimeReport = timeReportService.approveTimeReport(id, updateDTO.getIsApproved());
return ResponseEntity.ok(updatedTimeReport);
Expand Down

0 comments on commit 7d686d0

Please sign in to comment.