Part 2 has been ended. The Part 3: chanaged test

This commit is contained in:
2020-11-08 17:20:00 +01:00
parent a30c3af09c
commit 035de011f2
16 changed files with 82 additions and 82 deletions

View File

@ -5,7 +5,7 @@ import java.util.List;
import com.plannaplan.App;
import com.plannaplan.entities.User;
import com.plannaplan.responses.mappers.UserResponseMappers;
import com.plannaplan.responses.models.SearchForStudentsResponse;
import com.plannaplan.responses.models.UserResponse;
import com.plannaplan.services.UserService;
import org.springframework.beans.factory.annotation.Autowired;
@ -36,10 +36,10 @@ public class UsersController {
@GetMapping("/student/search")
@PreAuthorize("hasRole('ROLE_DEANERY')")
@ApiOperation(value = "Serch for user by providing query. If query is empty it will return all students. You need token with DEANERY role to call this")
public ResponseEntity<List<SearchForStudentsResponse>> configApp(
public ResponseEntity<List<UserResponse>> configApp(
@RequestParam("query") @ApiParam(value = "Query to filter all students. If empty will match everyone") String query) {
final List<User> searches = this.userService.searchForStudents(query);
final List<SearchForStudentsResponse> response = UserResponseMappers.mapToDefaultResponse(searches);
final List<UserResponse> response = UserResponseMappers.mapToDefaultResponse(searches);
return new ResponseEntity<>(response, HttpStatus.OK);
}
}