feat(backend): limit total members per user
This commit is contained in:
parent
80ac16694c
commit
4002893323
3 changed files with 21 additions and 4 deletions
|
@ -127,12 +127,14 @@ public static class ValidationUtils
|
|||
return errors;
|
||||
}
|
||||
|
||||
public const int MaxBioLength = 1024;
|
||||
|
||||
public static ValidationError? ValidateBio(string? bio)
|
||||
{
|
||||
return bio?.Length switch
|
||||
{
|
||||
0 => ValidationError.LengthError("Bio is too short", 1, 1024, bio.Length),
|
||||
> 1024 => ValidationError.LengthError("Bio is too long", 1, 1024, bio.Length),
|
||||
0 => ValidationError.LengthError("Bio is too short", 1, MaxBioLength, bio.Length),
|
||||
> MaxBioLength => ValidationError.LengthError("Bio is too long", 1, MaxBioLength, bio.Length),
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue