Application creating but without past visas and visits
This commit is contained in:
		| @@ -0,0 +1,14 @@ | ||||
| using AutoMapper; | ||||
| using BlazorWebAssemblyVisaApiClient.Validation.VisaApplications.Models; | ||||
| using VisaApiClient; | ||||
|  | ||||
| namespace BlazorWebAssemblyVisaApiClient.Infrastructure.AutoMapper.Profiles | ||||
| { | ||||
|     public class VisaApplicationCreateRequestProfile : Profile | ||||
|     { | ||||
|         public VisaApplicationCreateRequestProfile() | ||||
|         { | ||||
|             CreateMap<VisaApplicationCreateRequestModel, VisaApplicationCreateRequest>(MemberList.Destination); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,22 @@ | ||||
| using System.Text; | ||||
| using FluentValidation.Results; | ||||
|  | ||||
| namespace BlazorWebAssemblyVisaApiClient.Infrastructure.Helpers | ||||
| { | ||||
|     public static class ValidationResultExtensions | ||||
|     { | ||||
|         public static string ToErrorsString(this ValidationResult validationResult) | ||||
|             => ErrorsToString(validationResult.Errors.Select(e => e.ErrorMessage)); | ||||
|  | ||||
|         private static string ErrorsToString(IEnumerable<string> errors) | ||||
|         { | ||||
|             var stringBuilder = new StringBuilder(); | ||||
|             foreach (var error in errors) | ||||
|             { | ||||
|                 stringBuilder.Append($"{error}<br/>"); | ||||
|             } | ||||
|  | ||||
|             return stringBuilder.ToString(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -5,7 +5,7 @@ namespace BlazorWebAssemblyVisaApiClient.Infrastructure.Services.UserDataProvide | ||||
|     public interface IUserDataProvider | ||||
|     { | ||||
|  | ||||
|         public ApplicantModel? GetApplicant(); | ||||
|         public Task<ApplicantModel> GetApplicant(); | ||||
|  | ||||
|         public string? GetCurrentRole(); | ||||
|     } | ||||
|   | ||||
| @@ -8,10 +8,9 @@ namespace BlazorWebAssemblyVisaApiClient.Infrastructure.Services.UserDataProvide | ||||
|     { | ||||
|         private static readonly JwtSecurityTokenHandler tokenHandler = new (); | ||||
|  | ||||
|         public ApplicantModel? GetApplicant() | ||||
|         public async Task<ApplicantModel> GetApplicant() | ||||
|         { | ||||
|             //todo api action | ||||
|             return null; | ||||
|             return await client.GetApplicantAsync(); | ||||
|         } | ||||
|  | ||||
|         public string? GetCurrentRole() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user