summaryrefslogtreecommitdiff
path: root/internal/api/client/admin/admin.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-03-19 12:01:40 +0100
committerLibravatar GitHub <noreply@github.com>2022-03-19 12:01:40 +0100
commit55ad6dee716112e1a6c95cd53af0680ab3e8679a (patch)
tree37fe44052801ca3178a9a1c19a0a1ddddbbda96d /internal/api/client/admin/admin.go
parent[feature] Federate local account deletion (#431) (diff)
downloadgotosocial-55ad6dee716112e1a6c95cd53af0680ab3e8679a.tar.xz
[feature] Admin account actions (#432)
* add accountAction to the admin API * model admin account action * add admin account action to the processor * add migration for new AdminAccountActions table * fix accounts admin path * Update swagger docs
Diffstat (limited to 'internal/api/client/admin/admin.go')
-rw-r--r--internal/api/client/admin/admin.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/api/client/admin/admin.go b/internal/api/client/admin/admin.go
index f5256c996..7cf2c9bfc 100644
--- a/internal/api/client/admin/admin.go
+++ b/internal/api/client/admin/admin.go
@@ -35,6 +35,12 @@ const (
DomainBlocksPath = BasePath + "/domain_blocks"
// DomainBlocksPathWithID is used for interacting with a single domain block.
DomainBlocksPathWithID = DomainBlocksPath + "/:" + IDKey
+ // AccountsPath is used for listing + acting on accounts.
+ AccountsPath = BasePath + "/accounts"
+ // AccountsPathWithID is used for interacting with a single account.
+ AccountsPathWithID = AccountsPath + "/:" + IDKey
+ // AccountsActionPath is used for taking action on a single account.
+ AccountsActionPath = AccountsPathWithID + "/action"
// ExportQueryKey is for requesting a public export of some data.
ExportQueryKey = "export"
@@ -63,5 +69,6 @@ func (m *Module) Route(r router.Router) error {
r.AttachHandler(http.MethodGet, DomainBlocksPath, m.DomainBlocksGETHandler)
r.AttachHandler(http.MethodGet, DomainBlocksPathWithID, m.DomainBlockGETHandler)
r.AttachHandler(http.MethodDelete, DomainBlocksPathWithID, m.DomainBlockDELETEHandler)
+ r.AttachHandler(http.MethodPost, AccountsActionPath, m.AccountActionPOSTHandler)
return nil
}