From ab0d7c6a86ba6a7ac39a89897b79f2d41d84f79b Mon Sep 17 00:00:00 2001 From: Pasha Date: Fri, 6 Jun 2025 17:45:36 +0300 Subject: [PATCH] added new status code StatusAccepted for questions aditory not ready --- service/service.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/service/service.go b/service/service.go index 746fa66..5fd439f 100644 --- a/service/service.go +++ b/service/service.go @@ -244,6 +244,9 @@ func (s *Service) GetQuizData(c *fiber.Ctx) error { if req.NeedConfig { if len(questions) == 0 { + if req.Auditory != 0 { + return c.Status(fiber.StatusAccepted).SendString("questions are not ready yet") + } return c.Status(fiber.StatusNotFound).SendString("question not found") } @@ -342,10 +345,10 @@ func (s *Service) PutAnswersOnePiece(c *fiber.Ctx) error { if len(answersStr) == 0 { return c.Status(fiber.StatusFailedDependency).SendString("no answers provided") } - + versionStr, ok := form.Value["version"] var version int64 - + if ok && len(versionStr) > 0 { version, err = strconv.ParseInt(versionStr[0], 10, 32) if err != nil {