Skip to content

Commit

Permalink
Remove check
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaptoss committed Sep 10, 2024
1 parent 5649ec2 commit 0928ab1
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions internal/service/handlers/daily_question_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/go-chi/chi"
"github.com/rarimo/geo-auth-svc/pkg/auth"
"github.com/rarimo/geo-points-svc/internal/data"
"github.com/rarimo/geo-points-svc/internal/data/evtypes/models"
"github.com/rarimo/geo-points-svc/resources"
"gitlab.com/distributed_lab/ape"
"gitlab.com/distributed_lab/ape/problems"
Expand Down Expand Up @@ -47,20 +46,6 @@ func GetDailyQuestion(w http.ResponseWriter, r *http.Request) {

localDayStart := atDayStart(dq.LocalTime(time.Now().UTC()))

ev, err := EventsQ(r).FilterByNullifier(nullifier).FilterByType(models.TypeDailyQuestion).GetLast()
if err != nil {
log.WithError(err).Error("Failed to get last daily_question event")
ape.RenderErr(w, problems.InternalError())
return
}
if ev != nil &&
ev.CreatedAt > int32(localDayStart.Unix()) &&
ev.CreatedAt < int32(localDayStart.Add(24*time.Hour).Unix()) {
log.Debug("Points already accruing for daily question")
ape.RenderErr(w, problems.Conflict())
return
}

question, err := DailyQuestionsQ(r).FilterByStartsAtAfter(localDayStart).Get()
if err != nil {
log.WithError(err).Error("Failed to get question")
Expand Down

0 comments on commit 0928ab1

Please sign in to comment.