summaryrefslogtreecommitdiff
path: root/internal/db/bundb/account.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-09-11 13:19:06 +0200
committerLibravatar GitHub <noreply@github.com>2021-09-11 13:19:06 +0200
commit9dc2255a8fab8ef0bc4b9f417c6131e4c468cb9c (patch)
treeae528bf14a3475bbea264ff26e5ffded3dfadf8a /internal/db/bundb/account.go
parentTest both dbs (#205) (diff)
downloadgotosocial-9dc2255a8fab8ef0bc4b9f417c6131e4c468cb9c.tar.xz
kim is a reply guy (#208)
* bun debug * bun trace logging hooks * more tests * fix up some stuffffff * drop the frontend cache until a proper fix is made * go fmt
Diffstat (limited to 'internal/db/bundb/account.go')
-rw-r--r--internal/db/bundb/account.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/internal/db/bundb/account.go b/internal/db/bundb/account.go
index 32a70f7cd..745e41567 100644
--- a/internal/db/bundb/account.go
+++ b/internal/db/bundb/account.go
@@ -22,7 +22,6 @@ import (
"context"
"errors"
"fmt"
- "strings"
"time"
"github.com/superseriousbusiness/gotosocial/internal/cache"
@@ -103,16 +102,15 @@ func (a *accountDB) getAccount(ctx context.Context, cacheGet func() (*gtsmodel.A
}
func (a *accountDB) UpdateAccount(ctx context.Context, account *gtsmodel.Account) (*gtsmodel.Account, db.Error) {
- if strings.TrimSpace(account.ID) == "" {
- // TODO: we should not need this check here
- return nil, errors.New("account had no ID")
- }
-
- // Update the account's last-used
+ // Update the account's last-updated
account.UpdatedAt = time.Now()
// Update the account model in the DB
- _, err := a.conn.NewUpdate().Model(account).WherePK().Exec(ctx)
+ _, err := a.conn.
+ NewUpdate().
+ Model(account).
+ WherePK().
+ Exec(ctx)
if err != nil {
return nil, a.conn.ProcessError(err)
}