summaryrefslogtreecommitdiff
path: root/internal/db/account.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-04-13 13:25:10 +0200
committerLibravatar GitHub <noreply@github.com>2024-04-13 13:25:10 +0200
commit89e0cfd8741b6763ca04e90558bccf4c3c380cfa (patch)
tree5858ada73473816fa1982f12717b66996d163f9d /internal/db/account.go
parent[performance] update GetAccountsByIDs() to use the new multi cache loader end... (diff)
downloadgotosocial-89e0cfd8741b6763ca04e90558bccf4c3c380cfa.tar.xz
[feature] Admin accounts endpoints; approve/reject sign-ups (#2826)
* update settings panels, add pending overview + approve/deny functions * add admin accounts get, approve, reject * send approved/rejected emails * use signup URL * docs! * email * swagger * web linting * fix email tests * wee lil fixerinos * use new paging logic for GetAccounts() series of admin endpoints, small changes to query building * shuffle useAccountIDIn check *before* adding to query * fix parse from toot react error * use `netip.Addr` * put valid slices in globals * optimistic updates for account state --------- Co-authored-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/db/account.go')
-rw-r--r--internal/db/account.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/internal/db/account.go b/internal/db/account.go
index 45276f41f..7cdf7b57f 100644
--- a/internal/db/account.go
+++ b/internal/db/account.go
@@ -19,9 +19,11 @@ package db
import (
"context"
+ "net/netip"
"time"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
+ "github.com/superseriousbusiness/gotosocial/internal/paging"
)
// Account contains functions related to account getting/setting/creation.
@@ -56,6 +58,25 @@ type Account interface {
// GetAccountByFollowersURI returns one account with the given followers_uri, or an error if something goes wrong.
GetAccountByFollowersURI(ctx context.Context, uri string) (*gtsmodel.Account, error)
+ // GetAccounts returns accounts
+ // with the given parameters.
+ GetAccounts(
+ ctx context.Context,
+ origin string,
+ status string,
+ mods bool,
+ invitedBy string,
+ username string,
+ displayName string,
+ domain string,
+ email string,
+ ip netip.Addr,
+ page *paging.Page,
+ ) (
+ []*gtsmodel.Account,
+ error,
+ )
+
// PopulateAccount ensures that all sub-models of an account are populated (e.g. avatar, header etc).
PopulateAccount(ctx context.Context, account *gtsmodel.Account) error