Skip to content
Snippets Groups Projects
Commit 36360c3a authored by Jan Tymel's avatar Jan Tymel
Browse files

Remove empty rows in controllers

parent 69aaccca
No related branches found
No related tags found
No related merge requests found
......@@ -84,9 +84,7 @@ public class PhasesController {
public ResponseEntity<List<AbstractPhaseDTO>> getPhases(
@ApiParam(value = "Training definition ID", required = true)
@PathVariable(name = "definitionId") Long definitionId) {
List<AbstractPhaseDTO> phases = trainingPhaseFacade.getPhases(definitionId);
return new ResponseEntity<>(phases, HttpStatus.OK);
}
......@@ -106,9 +104,7 @@ public class PhasesController {
@PathVariable(name = "definitionId") Long definitionId,
@ApiParam(value = "Phase ID", required = true)
@PathVariable("phaseId") Long phaseId) {
AbstractPhaseDTO phase = trainingPhaseFacade.getPhase(definitionId, phaseId);
return new ResponseEntity<>(phase, HttpStatus.OK);
}
......@@ -128,9 +124,7 @@ public class PhasesController {
@PathVariable(name = "definitionId") Long definitionId,
@ApiParam(value = "Phase ID", required = true)
@PathVariable("phaseId") Long phaseId) {
List<AbstractPhaseDTO> remainingPhases = trainingPhaseFacade.deletePhase(definitionId, phaseId);
return new ResponseEntity<>(remainingPhases, HttpStatus.OK);
}
......@@ -152,9 +146,7 @@ public class PhasesController {
@PathVariable("phaseId") Long phaseId,
@ApiParam(value = "Info phase to be updated")
@RequestBody @Valid InfoPhaseUpdateDTO infoPhaseUpdateDto) {
InfoPhaseDTO updatedInfoPhase = trainingPhaseFacade.updateInfoPhase(definitionId, phaseId, infoPhaseUpdateDto);
return new ResponseEntity<>(updatedInfoPhase, HttpStatus.OK);
}
......@@ -176,9 +168,7 @@ public class PhasesController {
@PathVariable("phaseId") Long phaseId,
@ApiParam(value = "Training phase to be updated")
@RequestBody @Valid TrainingPhaseUpdateDTO trainingPhaseUpdateDto) {
TrainingPhaseDTO updatedTrainingPhase = trainingPhaseFacade.updateTrainingPhase(definitionId, phaseId, trainingPhaseUpdateDto);
return new ResponseEntity<>(updatedTrainingPhase, HttpStatus.OK);
}
......@@ -199,9 +189,7 @@ public class PhasesController {
@PathVariable("phaseId") Long phaseId,
@ApiParam(value = "Questionnaire to be updated")
@RequestBody @Valid QuestionnaireUpdateDTO questionnaireUpdateDto) {
QuestionnairePhaseDTO updatedQuestionnairePhase = trainingPhaseFacade.updateQuestionnairePhase(definitionId, phaseId, questionnaireUpdateDto);
return new ResponseEntity<>(updatedQuestionnairePhase, HttpStatus.OK);
}
......@@ -218,9 +206,7 @@ public class PhasesController {
public ResponseEntity<Void> movePhaseToSpecifiedOrder(
@ApiParam(value = "Phase ID - from", required = true) @PathVariable(name = "phaseIdFrom") Long phaseIdFrom,
@ApiParam(value = "Position (order) to which the phase should be moved", required = true) @PathVariable(name = "newPosition") int newPosition) {
trainingPhaseFacade.movePhaseToSpecifiedOrder(phaseIdFrom, newPosition);
return ResponseEntity.ok().build();
}
}
......@@ -56,9 +56,7 @@ public class TasksController {
@PathVariable(name = "definitionId") Long definitionId,
@ApiParam(value = "Training phase ID", required = true)
@PathVariable(name = "phaseId") Long phaseId) {
TaskDTO createdTask = taskService.createDefaultTask(definitionId, phaseId);
return new ResponseEntity<>(createdTask, HttpStatus.CREATED);
}
......@@ -81,9 +79,7 @@ public class TasksController {
@PathVariable(name = "phaseId") Long phaseId,
@ApiParam(value = "Task ID", required = true)
@PathVariable(name = "taskId") Long taskId) {
TaskDTO createdTask = taskService.cloneTask(definitionId, phaseId, taskId);
return new ResponseEntity<>(createdTask, HttpStatus.CREATED);
}
......@@ -106,9 +102,7 @@ public class TasksController {
@PathVariable(name = "phaseId") Long phaseId,
@ApiParam(value = "Task ID", required = true)
@PathVariable(name = "taskId") Long taskId) {
TaskDTO createdTask = taskService.getTask(definitionId, phaseId, taskId);
return new ResponseEntity<>(createdTask, HttpStatus.CREATED);
}
......@@ -132,9 +126,7 @@ public class TasksController {
@PathVariable(name = "taskId") Long taskId,
@ApiParam(value = "Task to be updated")
@RequestBody @Valid TaskUpdateDTO taskUpdateDto) {
TaskDTO updatedTask = taskService.updateTask(definitionId, phaseId, taskId, taskUpdateDto);
return new ResponseEntity<>(updatedTask, HttpStatus.OK);
}
......@@ -157,9 +149,7 @@ public class TasksController {
@PathVariable(name = "phaseId") Long phaseId,
@ApiParam(value = "Task ID", required = true)
@PathVariable(name = "taskId") Long taskId) {
taskService.removeTask(definitionId, phaseId, taskId);
return ResponseEntity.ok().build();
}
......@@ -176,9 +166,7 @@ public class TasksController {
public ResponseEntity<Void> moveTaskToSpecifiedOrder(
@ApiParam(value = "Task ID - from", required = true) @PathVariable(name = "taskIdFrom") Long taskIdFrom,
@ApiParam(value = "Position (order) to which the task should be moved", required = true) @PathVariable(name = "newPosition") int newPosition) {
taskService.moveTaskToSpecifiedOrder(taskIdFrom, newPosition);
return ResponseEntity.ok().build();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment