profile editing finished
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using FluentValidation;
|
||||
using WatchIt.Common.Model.Accounts;
|
||||
using WatchIt.Database;
|
||||
|
||||
namespace WatchIt.WebAPI.Validators.Accounts;
|
||||
|
||||
public class AccountProfileBackgroundRequestValidator : AbstractValidator<AccountProfileBackgroundRequest>
|
||||
{
|
||||
public AccountProfileBackgroundRequestValidator(DatabaseContext database)
|
||||
{
|
||||
RuleFor(x => x.Id).MustBeIn(database.MediaPhotoImages.Where(x => x.MediaPhotoImageBackground != null), x => x.Id)
|
||||
.WithMessage("Image has to be background");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user