Skip to content

Commit

Permalink
✨ edit empty locale on register step
Browse files Browse the repository at this point in the history
  • Loading branch information
codermuss committed Aug 11, 2024
1 parent 2a60663 commit cabf92a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion api/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ func (server *Server) RegisterUser(ctx *gin.Context) {
BirthDate: req.BirthDate,
}
argAfterCreate := func(user db.User) error {
taskPayload := &worker.PayloadSendVerifyEmail{Username: user.Username, Locale: localeValue}
var locale string
if len(localeValue) < 2 {
locale = util.DefaultLocale
} else {
locale = localeValue
}
taskPayload := &worker.PayloadSendVerifyEmail{Username: user.Username, Locale: locale}
opts := []asynq.Option{
asynq.MaxRetry(10),
asynq.ProcessIn(10 * time.Second),
Expand Down

0 comments on commit cabf92a

Please sign in to comment.