class AssessorProfileSkillsEditController {

    @PostMapping("/edit")
    public String submitSkills(Model model,
                               UserResource loggedInUser,
                               @Valid @ModelAttribute(FORM_ATTR_NAME) AssessorProfileSkillsForm form,
                               BindingResult bindingResult,
                               ValidationHandler validationHandler) {

        Supplier<String> failureView = () -> doViewEditSkills(model, loggedInUser, form, bindingResult);

        return validationHandler.failNowOrSucceedWith(failureView, () -> {
            ProfileSkillsEditResource profileSkillsEditResource = new ProfileSkillsEditResource();
            profileSkillsEditResource.setBusinessType(form.getAssessorType());
            profileSkillsEditResource.setSkillsAreas(form.getSkillAreas());
            ServiceResult<Void> result = profileRestService.updateProfileSkills(loggedInUser.getId(), profileSkillsEditResource).toServiceResult();

            return validationHandler.addAnyErrors(result, fieldErrorsToFieldErrors(), asGlobalErrors())
                    .failNowOrSucceedWith(failureView, () -> "redirect:/profile/skills");
        });
    }

}