Manage Appointments DONE!
This commit is contained in:
@@ -13,7 +13,7 @@ public class DoctorProfileValidation : AbstractValidator<DoctorProfileUpdateDto>
|
||||
|
||||
RuleFor(x => x.Id)
|
||||
.NotEmpty().WithMessage("Id is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString())
|
||||
.MustAsync(IsDoctorRegistered).WithMessage("Doctor is registered in system")
|
||||
.MustAsync(IsDoctorRegistered).WithMessage("Doctor is not registered in system")
|
||||
.WithErrorCode(HttpStatusCodes.NotFound.ToString());
|
||||
|
||||
RuleFor(x => x.Email)
|
||||
@@ -40,7 +40,7 @@ public class DoctorProfileValidation : AbstractValidator<DoctorProfileUpdateDto>
|
||||
private async Task<bool> IsDoctorRegistered(Guid id, CancellationToken cancellationToken)
|
||||
{
|
||||
var doctor = await _doctorRepository.GetByIdAsync(id);
|
||||
return doctor == null;
|
||||
return doctor != null;
|
||||
}
|
||||
|
||||
private async Task<bool> BeUniqueEmail(string email, CancellationToken cancellationToken)
|
||||
|
||||
Reference in New Issue
Block a user