chat implemented
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Application.Endpoints.Chats;
|
||||
|
||||
public class SendMessageValidator : AbstractValidator<SendMessageDto>
|
||||
{
|
||||
public SendMessageValidator()
|
||||
{
|
||||
RuleFor(x => x.Sender)
|
||||
.NotEmpty().WithMessage("Sender Id is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString());
|
||||
|
||||
RuleFor(x => x.Receiver)
|
||||
.NotEmpty().WithMessage("Receiver Id is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString());
|
||||
|
||||
RuleFor(x => x.Message)
|
||||
.NotEmpty().WithMessage("Message is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user