Fix validation

This commit is contained in:
rxdn 2022-02-14 19:19:10 +00:00
parent 0b8e63f718
commit 2cb8d25633
2 changed files with 2 additions and 6 deletions

View File

@ -91,8 +91,8 @@ func (b *inputCreateBody) Validate(ctx *gin.Context) bool {
return false
}
if len(b.Label) == 0 || len(b.Label) > 255 {
ctx.JSON(400, utils.ErrorStr("The input label must be between 1 and 255 characters"))
if len(b.Label) == 0 || len(b.Label) > 45 {
ctx.JSON(400, utils.ErrorStr("The input label must be between 1 and 45 characters"))
return false
}

4
go.sum
View File

@ -14,10 +14,6 @@ github.com/TicketsBot/common v0.0.0-20210910205523-7ce93fba6fa5/go.mod h1:SVwX6g
github.com/TicketsBot/database v0.0.0-20200516170158-fd8a949aec2c/go.mod h1:eky4tBL+IZ0svPgTT0N/9i6j7ygHDQH3784DW+HgfcA=
github.com/TicketsBot/database v0.0.0-20210902172951-4e1f8ced84b7/go.mod h1:A4T2uQFIWC/ttCYpfgv7AkPjR09mMRgzG13lgoV/+aI=
github.com/TicketsBot/database v0.0.0-20211108142700-c406ab0fc1bb/go.mod h1:72oWvH/Gq1iKeXCZhVRZn1JFbNVC5iAgERZWTrEarEo=
github.com/TicketsBot/database v0.0.0-20220213184807-16b6fe83ee5a h1:SfqC3eSlMmHbRWcOt4e34Foj3FGQVZv2sPCWkFn4hPQ=
github.com/TicketsBot/database v0.0.0-20220213184807-16b6fe83ee5a/go.mod h1:72oWvH/Gq1iKeXCZhVRZn1JFbNVC5iAgERZWTrEarEo=
github.com/TicketsBot/database v0.0.0-20220213185312-dc9f658164ba h1:22NdXBhrtyEWE8Pxe++Qn69WcPGjtsFNfBxpnTAVUzQ=
github.com/TicketsBot/database v0.0.0-20220213185312-dc9f658164ba/go.mod h1:72oWvH/Gq1iKeXCZhVRZn1JFbNVC5iAgERZWTrEarEo=
github.com/TicketsBot/database v0.0.0-20220213185554-1b21129e2e3b h1:yzEFTIygtUGRYqi92auS/mZbVR/Af03R0Jlf45TSN6I=
github.com/TicketsBot/database v0.0.0-20220213185554-1b21129e2e3b/go.mod h1:72oWvH/Gq1iKeXCZhVRZn1JFbNVC5iAgERZWTrEarEo=
github.com/TicketsBot/logarchiver v0.0.0-20200423221245-a3f92edf8c14/go.mod h1:whts8TRxrAF4WuDuEAMllkWA/inKem0NhDEFeyuoOvE=