MCPcopy Create free account
hub / github.com/Grashjs/cmms / update

Method update

api/src/main/java/com/grash/service/TaskService.java:35–43  ·  view source on GitHub ↗
(Long id, TaskPatchDTO task)

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 3

updateTaskMethod · 0.80
findByIdMethod · 0.45
refreshMethod · 0.45

Tested by

no test coverage detected