示例#1
0
        public async Task <SkillsViewModel> GetSkillsViewModelAsync(VacancyRouteModel vrm, string[] draftSkills = null)
        {
            var vacancy = await Utility.GetAuthorisedVacancyForEditAsync(_client, _vacancyClient, vrm, RouteNames.Skills_Get);

            var vm = new SkillsViewModel
            {
                Title = vacancy.Title
            };

            if (draftSkills == null)
            {
                _skillsHelper.SetViewModelSkillsFromVacancy(vm, vacancy);
            }
            else
            {
                _skillsHelper.SetViewModelSkillsFromDraftSkills(vm, draftSkills);
            }

            if (vacancy.Status == VacancyStatus.Referred)
            {
                vm.Review = await _reviewSummaryService.GetReviewSummaryViewModelAsync(vacancy.VacancyReference.Value,
                                                                                       ReviewFieldMappingLookups.GetSkillsFieldIndicators());
            }

            return(vm);
        }