summaryrefslogtreecommitdiff
path: root/internal/federation/federatingdb/update.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-08-25 15:34:33 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-25 15:34:33 +0200
commit2dc9fc1626507bb54417fc4a1920b847cafb27a2 (patch)
tree4ddeac479b923db38090aac8bd9209f3646851c1 /internal/federation/federatingdb/update.go
parentManually approves followers (#146) (diff)
downloadgotosocial-2dc9fc1626507bb54417fc4a1920b847cafb27a2.tar.xz
Pg to bun (#148)
* start moving to bun * changing more stuff * more * and yet more * tests passing * seems stable now * more big changes * small fix * little fixes
Diffstat (limited to 'internal/federation/federatingdb/update.go')
-rw-r--r--internal/federation/federatingdb/update.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/federation/federatingdb/update.go b/internal/federation/federatingdb/update.go
index 88ffc23b4..e9dfe5315 100644
--- a/internal/federation/federatingdb/update.go
+++ b/internal/federation/federatingdb/update.go
@@ -136,7 +136,7 @@ func (f *federatingDB) Update(ctx context.Context, asType vocab.Type) error {
accountable = i
}
- updatedAcct, err := f.typeConverter.ASRepresentationToAccount(accountable, true)
+ updatedAcct, err := f.typeConverter.ASRepresentationToAccount(ctx, accountable, true)
if err != nil {
return fmt.Errorf("UPDATE: error converting to account: %s", err)
}
@@ -152,7 +152,8 @@ func (f *federatingDB) Update(ctx context.Context, asType vocab.Type) error {
}
updatedAcct.ID = requestingAcct.ID // set this here so the db will update properly instead of trying to PUT this and getting constraint issues
- if err := f.db.UpdateByID(requestingAcct.ID, updatedAcct); err != nil {
+ updatedAcct, err = f.db.UpdateAccount(ctx, updatedAcct)
+ if err != nil {
return fmt.Errorf("UPDATE: database error inserting updated account: %s", err)
}