feat : add new version 0.21.24.41 , fix dont display product

release
Amir Hossein Khademi 2024-04-14 12:38:16 +03:30
parent 64a4510445
commit aaf1fb6b0a
6 changed files with 42 additions and 20 deletions

View File

@ -310,10 +310,14 @@ public class DiscountActionDialogBoxViewModel : BaseViewModel<DiscountLDto>
try
{
GetProductsResponseDto response = new GetProductsResponseDto();
var token = await _userUtility.GetBearerTokenAsync();
if (token == null)
throw new Exception("Token is null");
if (product.IsNullOrEmpty())
response = await _restWrapper.ProductRestApi.ReadAll(0,null,null);
response = await _restWrapper.ProductRestApi.ReadAll(0,null,null, token);
else
response = await _restWrapper.ProductRestApi.ReadAll(product);
response = await _restWrapper.ProductRestApi.ReadAll(product, token);
_products = response.Products;
return _products;
}

View File

@ -36,15 +36,13 @@
<MudItem xs="12" sm="4">
<MudField Variant="Variant.Outlined" Label="کد تخفیف">@ViewModel.PageDto.DiscountCode</MudField>
</MudItem>
<MudItem xs="12" sm="6">
<MudField Variant="Variant.Outlined" Label="آدرس">@ViewModel.PageDto?.OrderDelivery?.Address</MudField>
</MudItem>
<MudItem xs="12" sm="3">
<MudField Variant="Variant.Outlined" Label="روش ارسال">@ViewModel.PageDto?.OrderDelivery?.ShippingMethod</MudField>
</MudItem>
<MudItem xs="12" sm="3">
<MudField Variant="Variant.Outlined" Label="کدرهگیری ارسال">@ViewModel.PageDto?.OrderDelivery?.TrackingCode</MudField>
</MudItem>

View File

@ -28,9 +28,12 @@ public class ProductsPageViewModel : BaseViewModel<ObservableCollection<ProductS
{
try
{
var token = await _userUtility.GetBearerTokenAsync();
if (token == null)
throw new Exception("Token is null");
IsProcessing = true;
PageDto.Clear();
var dto = await _restWrapper.ProductRestApi.ReadAll(CurrentPage,null,null);
var dto = await _restWrapper.ProductRestApi.ReadAll(CurrentPage,null,null, token);
dto.Products.ForEach(d => PageDto.Add(d));
if (PageDto.Count == 20)
PageCount = 2;
@ -60,16 +63,19 @@ public class ProductsPageViewModel : BaseViewModel<ObservableCollection<ProductS
try
{
var token = await _userUtility.GetBearerTokenAsync();
if (token == null)
throw new Exception("Token is null");
IsProcessing = true;
GetProductsResponseDto dto = new GetProductsResponseDto();
if (Search.IsNullOrEmpty())
{
dto = await _restWrapper.ProductRestApi.ReadAll(CurrentPage,null,null);
dto = await _restWrapper.ProductRestApi.ReadAll(CurrentPage,null,null, token);
}
else
{
dto = await _restWrapper.ProductRestApi.ReadAll(CurrentPage, Search,null);
dto = await _restWrapper.ProductRestApi.ReadAll(CurrentPage, Search,null, token);
}
dto.Products.ForEach(d => PageDto.Add(d));
@ -177,15 +183,21 @@ public class ProductsPageViewModel : BaseViewModel<ObservableCollection<ProductS
{
if (Search.IsNullOrEmpty())
throw new AppException("دسته بندی برای جست جو وارد نشده است");
var token = await _userUtility.GetBearerTokenAsync();
if (token == null)
throw new Exception("Token is null");
IsProcessing = true;
CurrentPage = 0;
PageCount = 1;
PageDto.Clear();
GetProductsResponseDto dto;
if (SelectedCategory != null)
dto = await _restWrapper.ProductRestApi.ReadAll(CurrentPage, Search, SelectedCategory.Id);
dto = await _restWrapper.ProductRestApi.ReadAll(CurrentPage, Search, SelectedCategory.Id, token);
else
dto = await _restWrapper.ProductRestApi.ReadAll(CurrentPage, Search,null);
dto = await _restWrapper.ProductRestApi.ReadAll(CurrentPage, Search,null, token);
dto.Products.ForEach(d => PageDto.Add(d));
if (PageDto.Count == 20)
@ -245,10 +257,14 @@ public class ProductsPageViewModel : BaseViewModel<ObservableCollection<ProductS
return;
}
IsProcessing = true;
var token = await _userUtility.GetBearerTokenAsync();
if (token == null)
throw new Exception("Token is null");
CurrentPage = 0;
PageCount = 1;
PageDto.Clear();
GetProductsResponseDto dto = await _restWrapper.ProductRestApi.ReadAll(CurrentPage, Search, SelectedCategory.Id);
GetProductsResponseDto dto = await _restWrapper.ProductRestApi.ReadAll(CurrentPage, Search, SelectedCategory.Id, token);
dto.Products.ForEach(d => PageDto.Add(d));
if (PageDto.Count == 20)
@ -276,10 +292,13 @@ public class ProductsPageViewModel : BaseViewModel<ObservableCollection<ProductS
try
{
IsProcessing = true;
var token = await _userUtility.GetBearerTokenAsync();
if (token == null)
throw new Exception("Token is null");
CurrentPage = 0;
PageCount = 1;
PageDto.Clear();
GetProductsResponseDto dto = await _restWrapper.ProductRestApi.ReadAll(CurrentPage, Search, null);
GetProductsResponseDto dto = await _restWrapper.ProductRestApi.ReadAll(CurrentPage, Search, null, token);
dto.Products.ForEach(d => PageDto.Add(d));
if (PageDto.Count == 20)

View File

@ -11,11 +11,11 @@ public interface IProductRestApi
Task<GetProductResponseDto> ReadOne(Guid productId);
[Get("")]
Task<GetProductsResponseDto> ReadAll([Query] string productName);
Task<GetProductsResponseDto> ReadAll([Query] string productName, [Header("Authorization")] string authorization);
[Get("")]
Task<GetProductsResponseDto> ReadAll([Query] int page, [Query] string? productName, [Query] Guid? categoryId);
Task<GetProductsResponseDto> ReadAll([Query] int page, [Query] string? productName, [Query] Guid? categoryId, [Header("Authorization")] string authorization);
[Get("")]
Task<GetProductsResponseDto> ReadAll([Query] string productName, [Query] Guid categoryId);
Task<GetProductsResponseDto> ReadAll([Query] string productName, [Query] Guid categoryId, [Header("Authorization")] string authorization);
}

View File

@ -11,7 +11,8 @@
"تکمیل پروسه سفارش گیری",
"افزودن بخش تنظیمات فروشگاه",
"قابلیت افزودن تصویر به برند ها",
"قابلیت افزودن تصویر به دسته بندی محصولات"
"قابلیت افزودن تصویر به دسته بندی محصولات",
"عدم نمایش محصولات غیرقابل نمایش برای مشتری"
],
"bugFixes": [
"حل مشکلات امنیتی",

View File

@ -1214,6 +1214,10 @@ input:checked + .toggle-bg {
margin-bottom: -0.75rem;
}
.-mb-4 {
margin-bottom: -1rem;
}
.-ml-4 {
margin-left: -1rem;
}
@ -1322,10 +1326,6 @@ input:checked + .toggle-bg {
margin-top: 2rem;
}
.-mb-4 {
margin-bottom: -1rem;
}
.line-clamp-1 {
overflow: hidden;
display: -webkit-box;