Added empty table

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2020-11-05 16:14:50 +01:00
parent bd4591f442
commit 48fdeb726f

View File

@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@ -38,7 +39,7 @@ public class AssignmentsController extends TokenBasedController {
private AssignmentService assignmentService; private AssignmentService assignmentService;
@GetMapping("/user") @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 { public ResponseEntity<List<GetCurrentAssignmentsResponse>> getCurrentAssignments() throws Exception {
User user = this.getCurrentUser().orElseThrow(() -> new NullPointerException("User not found")); User user = this.getCurrentUser().orElseThrow(() -> new NullPointerException("User not found"));
Optional<Commision> com = this.commisionService.getNewestCommision(user); 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<>(AssignmentResponseMappers.mapToResponse(respone), HttpStatus.OK);
} }
return new ResponseEntity<>(null, HttpStatus.OK); return new ResponseEntity<>(new ArrayList<>(), HttpStatus.OK);
} }
} }