summaryrefslogtreecommitdiff
path: root/internal/db/statusfave.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-07-11 16:44:29 +0200
committerLibravatar GitHub <noreply@github.com>2024-07-11 15:44:29 +0100
commit5bc567196bf2204272950c525e8592e56057c3bd (patch)
tree24aec5e75d2a0208505da16ee2c55efd887d3e25 /internal/db/statusfave.go
parent[bugfix] Don't throw error when parent statuses are missing (#2011) (#3088) (diff)
downloadgotosocial-5bc567196bf2204272950c525e8592e56057c3bd.tar.xz
[chore] Add interaction policy gtsmodels (#3075)
* [chore] introduce interaction policy gts models * update migration a smidge * fix copy paste typo * update migration * use int for InteractionType
Diffstat (limited to 'internal/db/statusfave.go')
-rw-r--r--internal/db/statusfave.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/db/statusfave.go b/internal/db/statusfave.go
index 343a80caa..192ef436b 100644
--- a/internal/db/statusfave.go
+++ b/internal/db/statusfave.go
@@ -27,9 +27,12 @@ type StatusFave interface {
// GetStatusFaveByAccountID gets one status fave created by the given accountID, targeting the given statusID.
GetStatusFave(ctx context.Context, accountID string, statusID string) (*gtsmodel.StatusFave, error)
- // GetStatusFave returns one status fave with the given id.
+ // GetStatusFaveByID returns one status fave with the given id.
GetStatusFaveByID(ctx context.Context, id string) (*gtsmodel.StatusFave, error)
+ // GetStatusFaveByURI returns one status fave with the given uri.
+ GetStatusFaveByURI(ctx context.Context, uri string) (*gtsmodel.StatusFave, error)
+
// GetStatusFaves returns a slice of faves/likes of the status with given ID.
// This slice will be unfiltered, not taking account of blocks and whatnot, so filter it before serving it back to a user.
GetStatusFaves(ctx context.Context, statusID string) ([]*gtsmodel.StatusFave, error)
@@ -40,6 +43,9 @@ type StatusFave interface {
// PutStatusFave inserts the given statusFave into the database.
PutStatusFave(ctx context.Context, statusFave *gtsmodel.StatusFave) error
+ // UpdateStatusFave updates one statusFave in the database.
+ UpdateStatusFave(ctx context.Context, statusFave *gtsmodel.StatusFave, columns ...string) error
+
// DeleteStatusFave deletes one status fave with the given id.
DeleteStatusFaveByID(ctx context.Context, id string) error