/// <summary> /// The lawyer has confirmed they would like to initiate the matching process with the specified /// veteran. Add a new VeteranLawyerMatch row to the database to get the process started pending /// veteran approval. /// </summary> /// <param name="id">The primary key for the Veteran entity to match with</param> /// <returns>RedirectToPageResult to Index</returns> public async Task <IActionResult> OnPostAsync(string id) { Lawyer lawyer = await _lawyerService.GetLawyerByPrincipalAsync(User); if (await _lawyerService.MatchWithVeteranAsync(lawyer.ApplicationUserId, id, LibraryName)) { // TODO(taylorjoshuaw): The next steps of matching would take place at this // point. This could be e- mail, a built-in agreement // system to coordinate location / time, etc. return(RedirectToPage("Index")); } // Something went wrong, send the user back to Index. This could use a message // to clarify the situation to the user, but TempData </3 Azure. _logger.LogError($"An error occurred while attempted to match Lawyer id: {lawyer.ApplicationUserId} with Veteran id: {id}"); return(RedirectToPage("Index")); }