Orders work...
This commit is contained in:
@@ -12,7 +12,6 @@ public class CreateOrderCommand : IRequest<OrderDto>
|
||||
public int Quantity { get; set; }
|
||||
public Guid ProductId { get; set; }
|
||||
public Guid ProductVariantId { get; set; }
|
||||
public string? ComposingImageUrl { get; set; }
|
||||
public string[]? OriginalImageUrls { get; set; } = [];
|
||||
public string? CustomizationImageUrl { get; set; } = null!;
|
||||
public string? CustomizationDescription { get; set; } = null!;
|
||||
|
||||
@@ -17,7 +17,7 @@ public class GetProductById(
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var product = await unitOfWork.ProductRepository
|
||||
.GetByIdAsync(request.ProductId, cancellationToken);
|
||||
.GetByIdWithCategoryAsync(request.ProductId, cancellationToken);
|
||||
|
||||
if (product == null)
|
||||
return null;
|
||||
|
||||
@@ -25,13 +25,6 @@ public class CreateOrderCommandValidator : AbstractValidator<CreateOrderCommand>
|
||||
.NotEmpty()
|
||||
.WithMessage("Address ID is required.");
|
||||
|
||||
RuleFor(x => x.ComposingImageUrl)
|
||||
.MaximumLength(2048)
|
||||
.WithMessage("Composing image URL must not exceed 2048 characters.")
|
||||
.Must(BeValidUrl)
|
||||
.When(x => !string.IsNullOrEmpty(x.ComposingImageUrl))
|
||||
.WithMessage("Composing image URL must be a valid URL.");
|
||||
|
||||
RuleFor(x => x.CustomizationImageUrl)
|
||||
.MaximumLength(2048)
|
||||
.WithMessage("Customization image URL must not exceed 2048 characters.")
|
||||
|
||||
Reference in New Issue
Block a user