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:
@@ -15,6 +15,7 @@ namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
public string PictureBase64 { get; set; }
|
||||
public string PictureUri { get; set; }
|
||||
public string PictureName { get; set; }
|
||||
[Range(0.01, 10000)]
|
||||
public decimal Price { get; set; }
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints
|
||||
existingItem.UpdateBrand(request.CatalogBrandId);
|
||||
existingItem.UpdateType(request.CatalogTypeId);
|
||||
|
||||
if (string.IsNullOrEmpty(request.PictureBase64))
|
||||
if (string.IsNullOrEmpty(request.PictureBase64) && string.IsNullOrEmpty(request.PictureUri))
|
||||
{
|
||||
existingItem.UpdatePictureUri(string.Empty);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user