Change editor rule
This commit is contained in:
@@ -2,19 +2,20 @@ using FluentValidation;
|
||||
using Musify.Api.DataTransferObjects;
|
||||
using Musify.Application.Configuration;
|
||||
|
||||
namespace Musify.Api.Validators;
|
||||
|
||||
public sealed class PictureUploadRequestValidator : AbstractValidator<PictureUploadRequest>
|
||||
namespace Musify.Api.Validators
|
||||
{
|
||||
public PictureUploadRequestValidator(UploadIntentConfiguration uploadConfiguration)
|
||||
public sealed class PictureUploadRequestValidator : AbstractValidator<PictureUploadRequest>
|
||||
{
|
||||
RuleFor(x => x.FileType)
|
||||
.MustBeFileType(Uploads.PictureFileTypes);
|
||||
public PictureUploadRequestValidator(UploadIntentConfiguration uploadConfiguration)
|
||||
{
|
||||
RuleFor(x => x.FileType)
|
||||
.MustBeFileType(Uploads.PictureFileTypes);
|
||||
|
||||
RuleFor(x => x.ContentType)
|
||||
.MustBeContentType(Uploads.PictureContentTypes);
|
||||
RuleFor(x => x.ContentType)
|
||||
.MustBeContentType(Uploads.PictureContentTypes);
|
||||
|
||||
RuleFor(x => x.ExpectedSizeBytes)
|
||||
.MustBeValidUploadSize(uploadConfiguration.MaxUploadBytes);
|
||||
RuleFor(x => x.ExpectedSizeBytes)
|
||||
.MustBeValidUploadSize(uploadConfiguration.MaxUploadBytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user