Skip to content
Snippets Groups Projects

Fix Small Bugs (EditionID used as CohortID, Too Long URI, Person Search, Unhandled Declaration Hours)

8 files
+ 46
38
Compare changes
  • Side-by-side
  • Inline

Files

@@ -19,7 +19,6 @@ package nl.tudelft.tam.controller;
import java.util.AbstractMap;
import java.util.List;
import java.util.stream.Collectors;
import nl.tudelft.labracore.api.dto.PersonSummaryDTO;
import nl.tudelft.tam.model.Profile;
@@ -29,7 +28,7 @@ import nl.tudelft.tam.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@@ -52,15 +51,12 @@ public class PersonController {
* @param redirectAttrs The model attributes to keep when redirecting
* @return A redirect to the specific job offer page
*/
@GetMapping("find-candidate")
@PostMapping("find-candidate")
@PreAuthorize("@authorisationService.isManagerOfAny()")
public String findCandidates(@RequestParam Long offerId,
@RequestParam String identifiers,
RedirectAttributes redirectAttrs) {
List<PersonSummaryDTO> candidates = personService.searchForPeople(identifiers);
candidates = candidates.stream()
.filter(x -> !applicationService.appExistsFor(x.getId(), offerId))
.collect(Collectors.toList());
redirectAttrs.addFlashAttribute("specificOfferCandidates", candidates);
redirectAttrs.addFlashAttribute("specificOfferQuery", identifiers);
@@ -76,7 +72,7 @@ public class PersonController {
* @param redirectAttrs The model attributes to keep when redirecting
* @return A redirect to the specified page
*/
@GetMapping("find-people")
@PostMapping("find-people")
@PreAuthorize("@authorisationService.isManagerOfAny()")
public String findPeople(@RequestParam String returnPage,
@RequestParam String identifiers,
Loading