chore: Refactor handleAccountInfo function for improved readability and error handling

This commit is contained in:
Frederico Santos 2024-09-01 04:39:08 +01:00
parent d9caefed71
commit dff7579360

View File

@ -70,7 +70,10 @@ func handleAccountInfo(w http.ResponseWriter, r *http.Request) {
} }
} }
hasAdminRole, _ := account.IsUserDiscordAdmin(discordId, account.DiscordGuildID) var hasAdminRole bool
if discordId != "" {
hasAdminRole, _ = account.IsUserDiscordAdmin(discordId, account.DiscordGuildID)
}
response, err := account.Info(username, discordId, googleId, uuid, hasAdminRole) response, err := account.Info(username, discordId, googleId, uuid, hasAdminRole)
if err != nil { if err != nil {