100% test coverage on account service!

This commit is contained in:
ari melody 2026-07-31 04:46:32 +01:00
parent 5a540184c9
commit 8be785cd8b
Signed by: ari
GPG key ID: CF99829C92678188
5 changed files with 76 additions and 31 deletions

10
main.go
View file

@ -306,15 +306,7 @@ func main() {
}
account.Password = string(hashedPassword)
var email *string = nil
if account.Email.Valid { email = &account.Email.String }
var avatarURL *string = nil
if account.AvatarURL.Valid { email = &account.AvatarURL.String }
if err = app.AccountService.Update(
account.ID,
username, string(hashedPassword),
email, avatarURL,
); err != nil {
if err = app.AccountService.ChangePassword(account.ID, string(hashedPassword)); err != nil {
logger.Fatalf("FATAL: Failed to update password: %v\n", err)
}