Adding Admin API
This commit is contained in:
20
src/api/MicCheck.Api/Features/UpdateFeatureRequest.cs
Normal file
20
src/api/MicCheck.Api/Features/UpdateFeatureRequest.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace MicCheck.Api.Features;
|
||||
|
||||
public record UpdateFeatureRequest(
|
||||
string Name,
|
||||
string? Description
|
||||
);
|
||||
|
||||
public class UpdateFeatureRequestValidator : AbstractValidator<UpdateFeatureRequest>
|
||||
{
|
||||
public UpdateFeatureRequestValidator()
|
||||
{
|
||||
RuleFor(x => x.Name)
|
||||
.NotEmpty()
|
||||
.MaximumLength(150)
|
||||
.Matches("^[a-zA-Z0-9_-]+$")
|
||||
.WithMessage("Name may only contain letters, digits, underscores, and hyphens.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user