From 0d1e53653112facc21256b1e5067130ac80728d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Ga=C4=87e=C5=A1a?= Date: Wed, 22 May 2024 15:42:47 +0000 Subject: [PATCH] feat: [CODE-1788]: code comment block must start and end on the same side (#2053) --- app/api/controller/pullreq/comment_create.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/api/controller/pullreq/comment_create.go b/app/api/controller/pullreq/comment_create.go index 6fb087f8b..ed3b0358f 100644 --- a/app/api/controller/pullreq/comment_create.go +++ b/app/api/controller/pullreq/comment_create.go @@ -78,6 +78,10 @@ func (in *CommentCreateInput) Validate() error { return usererror.BadRequest("code comments require line numbers") } + if in.LineStartNew && !in.LineEndNew || !in.LineStartNew && in.LineEndNew { + return usererror.BadRequest("code block must start and end on the same side") + } + return nil }