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 req.NeedConfig {
|
||||||
if len(questions) == 0 {
|
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")
|
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 {
|
if len(answersStr) == 0 {
|
||||||
return c.Status(fiber.StatusFailedDependency).SendString("no answers provided")
|
return c.Status(fiber.StatusFailedDependency).SendString("no answers provided")
|
||||||
}
|
}
|
||||||
|
|
||||||
versionStr, ok := form.Value["version"]
|
versionStr, ok := form.Value["version"]
|
||||||
var version int64
|
var version int64
|
||||||
|
|
||||||
if ok && len(versionStr) > 0 {
|
if ok && len(versionStr) > 0 {
|
||||||
version, err = strconv.ParseInt(versionStr[0], 10, 32)
|
version, err = strconv.ParseInt(versionStr[0], 10, 32)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user