Skip to content

Commit

Permalink
Merge pull request #37 from rarimo/fix/admin
Browse files Browse the repository at this point in the history
Fix admins
  • Loading branch information
Zaptoss authored Sep 6, 2024
2 parents 95e2592 + fd245ec commit fa9d77a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/service/handlers/daily_question_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func CreateDailyQuestion(w http.ResponseWriter, r *http.Request) {
return
}
nowTime := time.Now().UTC()
if !timeReq.After(time.Date(nowTime.Year(), nowTime.Month(), nowTime.Day()+1, 0, 0, 0, 0, DailyQuestions(r).Location)) {
if !timeReq.After(time.Date(nowTime.Year(), nowTime.Month(), nowTime.Day(), 0, 0, 0, 0, DailyQuestions(r).Location)) {
Log(r).Errorf("Arg start_at must be more or equal tomorow midnoght noe: %s", timeReq.String())
ape.RenderErr(w, problems.BadRequest(validation.Errors{
"starts_at": fmt.Errorf("argument start_at must be more or equal tomorow midnoght now its: %s", timeReq.String()),
Expand Down
2 changes: 1 addition & 1 deletion internal/service/handlers/daily_questions_select.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func NewDailyQuestionModel(question data.DailyQuestion, loc *time.Location) (res
NumIncorrectAnswers: question.NumIncorrectAnswers,
Options: options,
Reward: question.Reward,
StartsAt: question.StartsAt.In(loc).String(),
StartsAt: question.StartsAt.In(loc).Format("2006-01-02"),
TimeForAnswer: question.TimeForAnswer,
Title: question.Title,
},
Expand Down
2 changes: 1 addition & 1 deletion internal/service/handlers/daily_questions_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func newDailyQuestionsStatus(question *data.DailyQuestion) resources.DailyQuesti
Key: resources.NewKeyInt64(question.ID, resources.DAILY_QUESTIONS_STATUS),
Attributes: resources.DailyQuestionsStatusAttributes{
NextQuestionDate: question.StartsAt.Unix(),
Reward: int64(question.Reward),
Reward: question.Reward,
TimeForAnswer: question.TimeForAnswer,
},
},
Expand Down

0 comments on commit fa9d77a

Please sign in to comment.