diff --git a/restservice/src/main/java/com/plannaplan/controllers/GroupController.java b/restservice/src/main/java/com/plannaplan/controllers/GroupController.java index b7afa55..478b6c1 100755 --- a/restservice/src/main/java/com/plannaplan/controllers/GroupController.java +++ b/restservice/src/main/java/com/plannaplan/controllers/GroupController.java @@ -6,7 +6,6 @@ import com.plannaplan.App; import com.plannaplan.entities.Groups; import com.plannaplan.responses.mappers.GroupsMappers; import com.plannaplan.responses.models.DefaultGroupResponse; -import com.plannaplan.responses.models.WithCapacityGroupResponse; import com.plannaplan.services.GroupService; import org.springframework.beans.factory.annotation.Autowired; @@ -18,8 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import io.vavr.control.Either; - @RestController @CrossOrigin @RequestMapping("/api/" + App.API_VERSION + "/groups") @@ -28,12 +25,12 @@ public class GroupController { private GroupService groupService; @GetMapping("/getCourseGroups") - public ResponseEntity, List>> getCourses( - @RequestParam("id") Long id, @RequestParam(name = "capacity", defaultValue = "true") Boolean capacity) { + public ResponseEntity> getCourses(@RequestParam("id") Long id, + @RequestParam(name = "capacity", defaultValue = "true") Boolean capacity) { List groups = this.groupService.getGroupsByCourse(id); if (capacity) { - return new ResponseEntity<>(Either.left(GroupsMappers.mapToCapacityResponse(groups)), HttpStatus.OK); + return new ResponseEntity<>(GroupsMappers.mapToCapacityResponse(groups), HttpStatus.OK); } - return new ResponseEntity<>(Either.right(GroupsMappers.mapToDefaultResponse(groups)), HttpStatus.OK); + return new ResponseEntity<>(GroupsMappers.mapToDefaultResponse(groups), HttpStatus.OK); } } \ No newline at end of file