feat: WIP connections query endpoint
This commit is contained in:
19
Validators/QueryPuzzlesRequestValidator.cs
Normal file
19
Validators/QueryPuzzlesRequestValidator.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using ConnectionsAPI.Models.Request;
|
||||
using FluentValidation;
|
||||
|
||||
namespace ConnectionsAPI.Validators;
|
||||
|
||||
public class QueryPuzzlesRequestValidator : Validator<QueryPuzzlesRequest>
|
||||
{
|
||||
public QueryPuzzlesRequestValidator()
|
||||
{
|
||||
RuleFor(x => x.Page)
|
||||
.Must(x => x > 0)
|
||||
.WithMessage("Page number must be a positive integer");
|
||||
|
||||
RuleFor(x => x.Count)
|
||||
.Must(x => x > 0)
|
||||
.WithMessage(x => "Item count must be a positive integer");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user