delete email from account queries, attention -> after hlog merge to staging, need fix git conflicts

This commit is contained in:
Pavel 2024-06-10 19:23:52 +03:00
parent f5603b818e
commit b3f6ed0827
5 changed files with 9 additions and 7 deletions

2
go.mod

@ -18,7 +18,7 @@ require (
google.golang.org/grpc v1.64.0
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-20240603140127-1a0489c42964
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240610161253-75e1867c7b36
penahub.gitlab.yandexcloud.net/backend/quiz/worker.git v0.0.0-20240421230341-0e086fcbb990
)

4
go.sum

@ -259,7 +259,7 @@ 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-20240603140127-1a0489c42964 h1:I44x6hYN9nAKcZU56FaJZ8pD3S7+lwuVX/CE9KkGzww=
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240603140127-1a0489c42964/go.mod h1:G1ZAWaQq6WW1wG9Shy57K4ZIezuhaBckQgsqQ+lhe94=
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240610161253-75e1867c7b36 h1:4cVsuo0H7tKRXH2FG/vgPMNyWpvFDbM3KqG6zw8Trzc=
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240610161253-75e1867c7b36/go.mod h1:n66zm88Dh12+idyfqh0vU5nd9BZYxM6Pv0XYnmy0398=
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=

@ -88,7 +88,6 @@ func (s *Service) createAccount(ctx *fiber.Ctx) error {
newAccount := model.Account{
UserID: accountID,
CreatedAt: time.Now(),
Email: email,
Deleted: false,
Privileges: map[string]model.ShortPrivilege{
"quizUnlimTime": {
@ -100,7 +99,8 @@ func (s *Service) createAccount(ctx *fiber.Ctx) error {
},
}
if err := s.dal.AccountRepo.CreateAccount(ctx.Context(), &newAccount); err != nil {
_, err = s.dal.AccountRepo.CreateAccount(ctx.Context(), &newAccount)
if err != nil {
return ctx.Status(fiber.StatusInternalServerError).SendString(err.Error())
}

@ -54,7 +54,8 @@ func (s *Service) CreateQuestion(ctx *fiber.Ctx) error {
Page: req.Page,
Content: req.Content,
}
if err := s.dal.QuestionRepo.CreateQuestion(ctx.Context(), &result); err != nil {
_, err := s.dal.QuestionRepo.CreateQuestion(ctx.Context(), &result)
if err != nil {
if e, ok := err.(*pq.Error); ok {
if e.Constraint == "quiz_relation" {
return ctx.Status(fiber.StatusFailedDependency).SendString(e.Error())

@ -90,7 +90,8 @@ func (s *Service) CreateQuiz(ctx *fiber.Ctx) error {
GroupId: req.GroupId,
}
if err := s.dal.QuizRepo.CreateQuiz(ctx.Context(), &record); err != nil {
_, err := s.dal.QuizRepo.CreateQuiz(ctx.Context(), &record)
if err != nil {
return ctx.Status(fiber.StatusInternalServerError).SendString(err.Error())
}