From 2cb8d25633725657c4b88989471596cb5cad6d4d Mon Sep 17 00:00:00 2001 From: rxdn <29165304+rxdn@users.noreply.github.com> Date: Mon, 14 Feb 2022 19:19:10 +0000 Subject: [PATCH] Fix validation --- app/http/endpoints/api/forms/createinput.go | 4 ++-- go.sum | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/http/endpoints/api/forms/createinput.go b/app/http/endpoints/api/forms/createinput.go index 1a65ce0..ded425d 100644 --- a/app/http/endpoints/api/forms/createinput.go +++ b/app/http/endpoints/api/forms/createinput.go @@ -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 } diff --git a/go.sum b/go.sum index db7d9a5..7b4c19b 100644 --- a/go.sum +++ b/go.sum @@ -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=