class InterviewApplicationAssignmentController extends CompetitionManagementCookieController<InterviewAssignmentSelectionForm> {

    @PostMapping(value = "/invite", params = "removeAll")
    public String removeAll(Model model,
                         @PathVariable("competitionId") long competitionId,
                         @RequestParam(defaultValue = "0") int page,
                         @RequestParam MultiValueMap<String, String> queryParams,
                         @ModelAttribute(name = "form") InterviewAssignmentSelectionForm selectionForm,
                         @SuppressWarnings("unused") BindingResult bindingResult,
                         ValidationHandler validationHandler) {

        Supplier<String> successView = () -> redirectToFind(competitionId, 0, Optional.empty());
        Supplier<String> failureView = () -> invite(model, competitionId, page, queryParams, selectionForm, bindingResult);

        RestResult<Void> result = interviewAssignmentRestService.unstageApplications(competitionId);
        return validationHandler.addAnyErrors(result)
                .failNowOrSucceedWith(failureView, successView);
    }

}