diff options
author | 2022-11-16 11:27:08 +0100 | |
---|---|---|
committer | 2022-11-16 11:27:08 +0100 | |
commit | 940abc279cb84e6bdb62326565b04c279bfb596b (patch) | |
tree | 2a8c03afcc57a70491d486391c0e638864b92017 /cmd | |
parent | [chore] update database caching library (#1040) (diff) | |
download | gotosocial-940abc279cb84e6bdb62326565b04c279bfb596b.tar.xz |
[chore] reversion: use specific columns for updating user again (#1059)
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/gotosocial/action/admin/account/account.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/cmd/gotosocial/action/admin/account/account.go b/cmd/gotosocial/action/admin/account/account.go index 070e1fdcb..e302fff57 100644 --- a/cmd/gotosocial/action/admin/account/account.go +++ b/cmd/gotosocial/action/admin/account/account.go @@ -151,8 +151,7 @@ var Promote action.GTSAction = func(ctx context.Context) error { admin := true u.Admin = &admin - u.UpdatedAt = time.Now() - if err := dbConn.UpdateUser(ctx, u); err != nil { + if err := dbConn.UpdateUser(ctx, u, "admin"); err != nil { return err } @@ -186,8 +185,7 @@ var Demote action.GTSAction = func(ctx context.Context) error { admin := false u.Admin = &admin - u.UpdatedAt = time.Now() - if err := dbConn.UpdateUser(ctx, u); err != nil { + if err := dbConn.UpdateUser(ctx, u, "admin"); err != nil { return err } @@ -221,8 +219,7 @@ var Disable action.GTSAction = func(ctx context.Context) error { disabled := true u.Disabled = &disabled - u.UpdatedAt = time.Now() - if err := dbConn.UpdateUser(ctx, u); err != nil { + if err := dbConn.UpdateUser(ctx, u, "disabled"); err != nil { return err } @@ -268,8 +265,7 @@ var Password action.GTSAction = func(ctx context.Context) error { } u.EncryptedPassword = string(pw) - u.UpdatedAt = time.Now() - if err := dbConn.UpdateUser(ctx, u); err != nil { + if err := dbConn.UpdateUser(ctx, u, "encrypted_password"); err != nil { return err } |