Merge branch 'tmplCopy' into 'staging'

Tmpl copy

See merge request backend/quiz/core!15
This commit is contained in:
Mikhail 2024-05-17 18:45:24 +00:00
commit c6c5615d21
4 changed files with 15 additions and 6 deletions

2
go.mod

@ -18,7 +18,7 @@ require (
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.34.1
penahub.gitlab.yandexcloud.net/backend/penahub_common v0.0.0-20240223054633-6cb3d5ce45b6
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240514141840-e6c3cb41f500
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240517141141-18672a757abc
penahub.gitlab.yandexcloud.net/backend/quiz/worker.git v0.0.0-20240421230341-0e086fcbb990
)

6
go.sum

@ -262,7 +262,9 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
penahub.gitlab.yandexcloud.net/backend/penahub_common v0.0.0-20240223054633-6cb3d5ce45b6 h1:oV+/HNX+JPoQ3/GUx08hio7d45WpY0AMGrFs7j70QlA=
penahub.gitlab.yandexcloud.net/backend/penahub_common v0.0.0-20240223054633-6cb3d5ce45b6/go.mod h1:lTmpjry+8evVkXWbEC+WMOELcFkRD1lFMc7J09mOndM=
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240514141840-e6c3cb41f500 h1:JFZJ2ynEJRH8e1q+mTn+v02qjSSbg4XjOZAwx10IHDY=
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240514141840-e6c3cb41f500/go.mod h1:oRyhT55ctjqp/7ZxIzkR7OsQ7T/NLibsfrbb7Ytns64=
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240513111030-284699448096 h1:Ad9OvXNK9Yx3dH3TIle24pYilE+IoCgewZv7Yw9RP9M=
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240513111030-284699448096/go.mod h1:/DcyAjBh41IbomuDu5QzhL9flZW6lWO3ZAEbUXKobk0=
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240517141141-18672a757abc h1:K2oxiU2xyibqqibkL77NQFCLfB3ZRLg7HxdTVPxIyOk=
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240517141141-18672a757abc/go.mod h1:oRyhT55ctjqp/7ZxIzkR7OsQ7T/NLibsfrbb7Ytns64=
penahub.gitlab.yandexcloud.net/backend/quiz/worker.git v0.0.0-20240421230341-0e086fcbb990 h1:jiO8GWO+3sCnDAV8/NAV8tQIUwae/I6/xiDilW7zf0o=
penahub.gitlab.yandexcloud.net/backend/quiz/worker.git v0.0.0-20240421230341-0e086fcbb990/go.mod h1:zswBuTwmEsFHBVRu1nkG3/Fwylk5Vcm8OUm9iWxccSE=

@ -1450,7 +1450,14 @@ paths:
required: true
responses:
'200':
description: Success
description: возвращает id нового квиза
content:
application/json:
schema:
type: object
properties:
id:
type: number
'400':
description: Invalid request
content:

@ -503,10 +503,10 @@ func (s *Service) TemplateCopy(ctx *fiber.Ctx) error {
return ctx.Status(fiber.StatusBadRequest).SendString("Invalid request qid is required")
}
err := s.dal.QuizRepo.TemplateCopy(ctx.Context(), accountID, req.Qid)
qizID, err := s.dal.QuizRepo.TemplateCopy(ctx.Context(), accountID, req.Qid)
if err != nil {
return ctx.Status(fiber.StatusInternalServerError).SendString(err.Error())
}
return ctx.SendStatus(fiber.StatusOK)
return ctx.Status(fiber.StatusOK).JSON(fiber.Map{"id": qizID})
}