big ole refactor

This commit is contained in:
2026-02-14 19:48:59 +11:00
parent e34bec2f9d
commit f9283c0563
66 changed files with 989 additions and 1114 deletions

View File

@@ -16,7 +16,7 @@ import (
func Logout(
s *hws.Server,
auth *hwsauth.Authenticator[*db.User, bun.Tx],
conn *bun.DB,
conn *db.DB,
discordAPI *discord.APIClient,
) http.Handler {
return http.HandlerFunc(
@@ -27,7 +27,7 @@ func Logout(
w.Header().Set("HX-Redirect", "/")
return
}
if ok := db.WithWriteTx(s, w, r, conn, func(ctx context.Context, tx bun.Tx) (bool, error) {
if ok := conn.WithWriteTx(s, w, r, func(ctx context.Context, tx bun.Tx) (bool, error) {
token, err := user.DeleteDiscordTokens(ctx, tx)
if err != nil {
return false, errors.Wrap(err, "user.DeleteDiscordTokens")