(Long id, TaskPatchDTO task)
| 33 | } |
| 34 | |
| 35 | @Transactional |
| 36 | public Task update(Long id, TaskPatchDTO task) { |
| 37 | if (taskRepository.existsById(id)) { |
| 38 | Task savedTask = taskRepository.findById(id).get(); |
| 39 | Task updatedTask = taskRepository.saveAndFlush(taskMapper.updateTask(savedTask, task)); |
| 40 | em.refresh(updatedTask); |
| 41 | return updatedTask; |
| 42 | } else throw new CustomException("Not found", HttpStatus.NOT_FOUND); |
| 43 | } |
| 44 | |
| 45 | public Collection<Task> getAll() { |
| 46 | return taskRepository.findAll(); |
nothing calls this directly
no test coverage detected