diff --git a/ShopAdmin/Components/CreateProduct.razor b/ShopAdmin/Components/CreateProduct.razor
index 227a2f9..ea6b2bd 100644
--- a/ShopAdmin/Components/CreateProduct.razor
+++ b/ShopAdmin/Components/CreateProduct.razor
@@ -93,6 +93,7 @@
+
@if (string.IsNullOrEmpty(ProductModel.ImageUrl))
{
diff --git a/ShopAdmin/Components/CreateProduct.razor.cs b/ShopAdmin/Components/CreateProduct.razor.cs
index a8b7565..8f75892 100644
--- a/ShopAdmin/Components/CreateProduct.razor.cs
+++ b/ShopAdmin/Components/CreateProduct.razor.cs
@@ -8,7 +8,6 @@ public partial class CreateProduct([FromKeyedServices(BookshopBucketName)] IS3Se
private bool isCalendarOpen = false;
private DateTime calendarViewingMonth = DateTime.Today;
private List calendarDays = new();
- private string currentCalendarMonthYearText => calendarViewingMonth.ToString("MMMM yyyy");
private readonly CancellationTokenSource cancellationTokenSource = new();
private CancellationToken cancellationToken;
@@ -189,27 +188,33 @@ public partial class CreateProduct([FromKeyedServices(BookshopBucketName)] IS3Se
public class CreateProductModel
{
+ [MaxLength(128)]
[Required(ErrorMessage = "Product name is required.")]
public string? Name { get; set; }
+ [MaxLength(512)]
[Required(ErrorMessage = "Summary is required.")]
public string? Summary { get; set; }
+ [MaxLength(2048)]
[Required(ErrorMessage = "Description is required.")]
public string? Description { get; set; }
[Range(0.01, double.MaxValue, ErrorMessage = "Price must be greater than zero.")]
public decimal Price { get; set; }
+ [MaxLength(128)]
[Required(ErrorMessage = "Author metadata is required.")]
public string? Author { get; set; }
[Required(ErrorMessage = "Publication Date is required.")]
public DateTime PublishDate { get; set; } = DateTime.Today;
+ [MaxLength(255)]
[Required(ErrorMessage = "Copyright Information field is required.")]
public string? CopyrightInfo { get; set; }
+ [MaxLength(128)]
[Required(ErrorMessage = "ISBN code is required.")]
[RegularExpression(@"^(?=(?:\D*\d){10}(?:(?:\D*\d){3})?$)[\d-]+$", ErrorMessage = "Please enter a valid ISBN-10 or ISBN-13 string.")]
public string? Isbn { get; set; }