Skip to content
Snippets Groups Projects

Add TA Training + PayScale Import

Files

@@ -17,10 +17,12 @@
*/
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;
import nl.tudelft.tam.service.ApplicationService;
import nl.tudelft.tam.service.PersonService;
@@ -66,4 +68,28 @@ public class PersonController {
return "redirect:/job-offer/" + offerId;
}
/**
* Search for people based on one or a list of identifiers.
*
* @param returnPage The page to be redirected to after the request is completed
* @param identifiers The identifiers to identify the people searched for
* @param redirectAttrs The model attributes to keep when redirecting
* @return A redirect to the specified page
*/
@GetMapping("find-people")
@PreAuthorize("@authorisationService.isManagerOfAny()")
public String findPeople(@RequestParam String returnPage,
@RequestParam String identifiers,
@RequestParam String newValue,
RedirectAttributes redirectAttrs) {
List<AbstractMap.SimpleEntry<PersonSummaryDTO, Profile>> people = personService
.findPersonProfilePairs(identifiers);
redirectAttrs.addFlashAttribute("foundPeople", people);
redirectAttrs.addFlashAttribute("searchQuery", identifiers);
redirectAttrs.addFlashAttribute("newValue", newValue);
return "redirect:" + returnPage;
}
}
Loading