added new status code StatusAccepted for questions aditory not ready
This commit is contained in:
parent
47f36ec559
commit
ab0d7c6a86
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user