public async Task <IActionResult> OrganisationDetails(ViewAndEditOrganisationViewModel vm) { var ukprn = _contextAccessor.HttpContext.User.Claims.FirstOrDefault(c => c.Type == "http://schemas.portal.com/ukprn")?.Value; if (vm.ActionChoice == "Enable") { await _externalApiClient.CreateUser(ukprn); return(RedirectToAction(nameof(OrganisationDetails), nameof(OrganisationController).RemoveController(), "api-subscription")); } return(RedirectToAction(nameof(OrganisationDetails), nameof(OrganisationController).RemoveController(), "register-details")); }
private ViewAndEditOrganisationViewModel MapOrganisationModel(EpaOrganisation organisation) { var viewModel = new ViewAndEditOrganisationViewModel { OrganisationId = organisation.OrganisationId, Email = organisation.OrganisationData?.Email, PhoneNumber = organisation.OrganisationData?.PhoneNumber, WebsiteLink = organisation.OrganisationData?.WebsiteLink, Address1 = organisation.OrganisationData?.Address1, Address2 = organisation.OrganisationData?.Address2, Address3 = organisation.OrganisationData?.Address3, Address4 = organisation.OrganisationData?.Address4, Postcode = organisation.OrganisationData?.Postcode, PrimaryContact = !string.IsNullOrEmpty(organisation.PrimaryContact) ? organisation.PrimaryContact : string.Empty, PrimaryContactName = !string.IsNullOrEmpty(organisation.PrimaryContactName) ? organisation.PrimaryContactName : string.Empty }; return(viewModel); }