From 89e0cfd8741b6763ca04e90558bccf4c3c380cfa Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 13 Apr 2024 13:25:10 +0200 Subject: [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 --- internal/db/account.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'internal/db/account.go') 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 -- cgit v1.2.3