updated LastVerificationSentAt and LastResetSentAt fill sequence

This commit is contained in:
Gani Georgiev
2023-08-17 14:03:11 +03:00
parent c8ef3c4050
commit 53b20ec104
7 changed files with 17 additions and 15 deletions

View File

@@ -75,14 +75,14 @@ func (form *AdminPasswordResetRequest) Submit(interceptors ...InterceptorFunc[*m
return errors.New("You have already requested a password reset.")
}
// update last sent timestamp
admin.LastResetSentAt = types.NowDateTime()
return runInterceptors(admin, func(m *models.Admin) error {
if err := mails.SendAdminPasswordReset(form.app, m); err != nil {
return err
}
// update last sent timestamp
m.LastResetSentAt = types.NowDateTime()
return form.dao.SaveAdmin(m)
}, interceptors...)
}