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 try
{ {
GetProductsResponseDto response = new GetProductsResponseDto(); GetProductsResponseDto response = new GetProductsResponseDto();
var token = await _userUtility.GetBearerTokenAsync();
if (token == null)
throw new Exception("Token is null");
if (product.IsNullOrEmpty()) if (product.IsNullOrEmpty())
response = await _restWrapper.ProductRestApi.ReadAll(0,null,null); response = await _restWrapper.ProductRestApi.ReadAll(0,null,null, token);
else else
response = await _restWrapper.ProductRestApi.ReadAll(product); response = await _restWrapper.ProductRestApi.ReadAll(product, token);
_products = response.Products; _products = response.Products;
return _products; return _products;
} }

View File

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

View File

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

View File

@ -11,11 +11,11 @@ public interface IProductRestApi
Task<GetProductResponseDto> ReadOne(Guid productId); Task<GetProductResponseDto> ReadOne(Guid productId);
[Get("")] [Get("")]
Task<GetProductsResponseDto> ReadAll([Query] string productName); Task<GetProductsResponseDto> ReadAll([Query] string productName, [Header("Authorization")] string authorization);
[Get("")] [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("")] [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": [ "bugFixes": [
"حل مشکلات امنیتی", "حل مشکلات امنیتی",

View File

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