Refactor: Update Protobuf references to CMSMicroservice across multiple components
- Changed Protobuf imports from FrontOffice.BFF to CMSMicroservice in Profile components (EditAddressDialog, Index, PaymentCallback, Personal, Settings). - Updated CheckoutSummary, OrderDetail, OrderTracking, and Orders pages to use new UserOrder Protobuf definitions. - Refactored WalletService, PackageService, and other utility services to align with new Protobuf structure. - Adjusted appsettings.json for local development URL. - Removed unused validators and simplified validation logic in AuthDialog. - Enhanced ClubMembershipContractDialog to utilize new OtpToken service for OTP handling.
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
using FrontOffice.BFF.UserAddress.Protobuf.Protos.UserAddress;
|
||||
using FrontOffice.BFF.UserAddress.Protobuf.Validator;
|
||||
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
||||
using CMSMicroservice.Protobuf.Protos.City;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
using Severity = MudBlazor.Severity;
|
||||
using CityProto = FrontOffice.BFF.City.Protobuf;
|
||||
|
||||
namespace FrontOffice.Main.Pages.Profile.Components;
|
||||
|
||||
@@ -12,15 +11,14 @@ public partial class EditAddressDialog : ComponentBase
|
||||
{
|
||||
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; } = default!;
|
||||
[Inject] private UserAddressContract.UserAddressContractClient UserAddressContract { get; set; } = default!;
|
||||
[Inject] private CityProto.CityContract.CityContractClient CityContract { get; set; } = default!;
|
||||
[Inject] private CityContract.CityContractClient CityContract { get; set; } = default!;
|
||||
|
||||
[Parameter] public GetAllUserAddressByFilterResponseModel? Model { get; set; }
|
||||
|
||||
private MudForm? _form;
|
||||
private readonly UpdateUserAddressRequestValidator _validator = new();
|
||||
private bool _isSaving;
|
||||
private UpdateUserAddressRequest _request = new();
|
||||
private CityProto.GetAllCitiesByFilterResponseModel? _selectedCity;
|
||||
private object? _selectedCity;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
@@ -41,13 +39,13 @@ public partial class EditAddressDialog : ComponentBase
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = await CityContract.GetAllCitiesByFilterAsync(new CityProto.GetAllCitiesByFilterRequest
|
||||
var response = await CityContract.GetAllCitiesByFilterAsync(new GetAllCitiesByFilterRequest
|
||||
{
|
||||
PaginationState = new CityProto.PaginationState { PageNumber = 1, PageSize = 1 },
|
||||
Filter = new CityProto.GetAllCitiesByFilterFilter { Id = cityId }
|
||||
PaginationState = new CMSMicroservice.Protobuf.Protos.City.PaginationState { PageNumber = 1, PageSize = 1 },
|
||||
Filter = new GetAllCitiesByFilterFilter { Id = cityId }
|
||||
});
|
||||
|
||||
_selectedCity = response?.Models?.FirstOrDefault();
|
||||
_selectedCity = response?.Cities?.FirstOrDefault();
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -55,24 +53,24 @@ public partial class EditAddressDialog : ComponentBase
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<IEnumerable<CityProto.GetAllCitiesByFilterResponseModel>> SearchCities(string value, CancellationToken ct)
|
||||
private async Task<IEnumerable<object>> SearchCities(string value, CancellationToken ct)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(value) || value.Length < 2)
|
||||
return Enumerable.Empty<CityProto.GetAllCitiesByFilterResponseModel>();
|
||||
return Enumerable.Empty<object>();
|
||||
|
||||
try
|
||||
{
|
||||
var response = await CityContract.GetAllCitiesByFilterAsync(new CityProto.GetAllCitiesByFilterRequest
|
||||
var response = await CityContract.GetAllCitiesByFilterAsync(new GetAllCitiesByFilterRequest
|
||||
{
|
||||
PaginationState = new CityProto.PaginationState { PageNumber = 1, PageSize = 20 },
|
||||
Filter = new CityProto.GetAllCitiesByFilterFilter { Native = value }
|
||||
}, cancellationToken: ct);
|
||||
|
||||
return response?.Models?.ToList() ?? new List<CityProto.GetAllCitiesByFilterResponseModel>();
|
||||
PaginationState = new CMSMicroservice.Protobuf.Protos.City.PaginationState { PageNumber = 1, PageSize = 20 },
|
||||
Filter = new GetAllCitiesByFilterFilter { Name = value }
|
||||
});
|
||||
|
||||
return response?.Cities?.Cast<object>() ?? Enumerable.Empty<object>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return Enumerable.Empty<CityProto.GetAllCitiesByFilterResponseModel>();
|
||||
return Enumerable.Empty<object>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +86,7 @@ public partial class EditAddressDialog : ComponentBase
|
||||
return;
|
||||
}
|
||||
|
||||
_request.CityId = _selectedCity.Id;
|
||||
_request.CityId = (long)((dynamic)_selectedCity).Id;
|
||||
_isSaving = true;
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user