Shady nagy/remove newton soft (#436)
* replace NewtonSoft with System.Text.Json * not use auth for brande and types and use GetFromJsonAsync * fix * fix * Auth HttpGet more simple. * Put, Delete and Post more simple. * Fixed Edit for remove image and keep image and change other fields. Added description required in Blazor Admin. * Removed using not used * Refactor AuthService and introduce HttpService. add validation for price. * return null in HttpService if not success. * Limt Price to 1000 mximum * DI for Blazor Services * one blazor service. * fix
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
@page "/admin"
|
||||
@attribute [Authorize(Roles = BlazorShared.Authorization.Constants.Roles.ADMINISTRATORS)]
|
||||
@inject AuthService Auth
|
||||
@inject BlazorAdmin.Services.CatalogItemServices.ListPaged CatalogItemListPaged
|
||||
@inject BlazorAdmin.Services.CatalogTypeServices.List TypeList
|
||||
@inject BlazorAdmin.Services.CatalogBrandServices.List BrandList
|
||||
@inherits BlazorAdmin.Helpers.BlazorComponent
|
||||
@namespace BlazorAdmin.Pages.CatalogItemPage
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ namespace BlazorAdmin.Pages.CatalogItemPage
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
catalogItems = await new BlazorAdmin.Services.CatalogItemServices.ListPaged(Auth).HandleAsync(50);
|
||||
catalogTypes = await new BlazorAdmin.Services.CatalogTypeServices.List(Auth).HandleAsync();
|
||||
catalogBrands = await new BlazorAdmin.Services.CatalogBrandServices.List(Auth).HandleAsync();
|
||||
catalogItems = await CatalogItemListPaged.HandleAsync(50);
|
||||
catalogTypes = await TypeList.HandleAsync();
|
||||
catalogBrands = await BrandList.HandleAsync();
|
||||
|
||||
CallRequestRefresh();
|
||||
}
|
||||
@@ -37,9 +37,9 @@ namespace BlazorAdmin.Pages.CatalogItemPage
|
||||
await DetailsComponent.Open(id);
|
||||
}
|
||||
|
||||
private void CreateClick()
|
||||
private async Task CreateClick()
|
||||
{
|
||||
CreateComponent.Open();
|
||||
await CreateComponent.Open();
|
||||
}
|
||||
|
||||
private async Task EditClick(int id)
|
||||
|
||||
Reference in New Issue
Block a user