Merge pull request 'Added empty table' (#21) from ZPI-144 into master
Reviewed-on: http://git.plannaplan.pl/filipizydorczyk/backend/pulls/21
This commit is contained in:
commit
8ba148617a
@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@ -38,7 +39,7 @@ public class AssignmentsController extends TokenBasedController {
|
||||
private AssignmentService assignmentService;
|
||||
|
||||
@GetMapping("/user")
|
||||
@ApiOperation(value = "Retrun user current assignemts (from newest commision). STUDENT Token needs to be provided.")
|
||||
@ApiOperation(value = "Return user current assignemts (from newest commision). STUDENT Token needs to be provided.")
|
||||
public ResponseEntity<List<GetCurrentAssignmentsResponse>> getCurrentAssignments() throws Exception {
|
||||
User user = this.getCurrentUser().orElseThrow(() -> new NullPointerException("User not found"));
|
||||
Optional<Commision> com = this.commisionService.getNewestCommision(user);
|
||||
@ -48,6 +49,6 @@ public class AssignmentsController extends TokenBasedController {
|
||||
return new ResponseEntity<>(AssignmentResponseMappers.mapToResponse(respone), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<>(null, HttpStatus.OK);
|
||||
return new ResponseEntity<>(new ArrayList<>(), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user