summaryrefslogtreecommitdiff
path: root/internal/api/client/admin/admin.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-12-10 22:43:11 +0100
committerLibravatar GitHub <noreply@github.com>2022-12-10 21:43:11 +0000
commit5e060d0bcb9af77e7b6d11acba99db6219d4f68e (patch)
tree8dee821f5577ed38be754d73370ed2b74c8f0d2b /internal/api/client/admin/admin.go
parent[chore] make single pull request template (#1239) (diff)
downloadgotosocial-5e060d0bcb9af77e7b6d11acba99db6219d4f68e.tar.xz
[feature] Start implementing refetch of lost media files via `/api/v1/admin/media_refetch` (#1221)
* [chore] Move ShortcodeDomain to its own little util func * [feature] Add RefetchEmojis function to media manager * [feature] Expose admin media refresh via admin API * update following review feedback - change/fix log levels - make sure not to try to refetch local emojis - small style refactoring + comments * log on emoji refetch start Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/api/client/admin/admin.go')
-rw-r--r--internal/api/client/admin/admin.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/api/client/admin/admin.go b/internal/api/client/admin/admin.go
index 7032a5b95..569354c96 100644
--- a/internal/api/client/admin/admin.go
+++ b/internal/api/client/admin/admin.go
@@ -46,6 +46,7 @@ const (
// AccountsActionPath is used for taking action on a single account.
AccountsActionPath = AccountsPathWithID + "/action"
MediaCleanupPath = BasePath + "/media_cleanup"
+ MediaRefetchPath = BasePath + "/media_refetch"
// ExportQueryKey is for requesting a public export of some data.
ExportQueryKey = "export"
@@ -63,6 +64,8 @@ const (
MinShortcodeDomainKey = "min_shortcode_domain"
// LimitKey is for specifying maximum number of results to return.
LimitKey = "limit"
+ // DomainQueryKey is for specifying a domain during admin actions.
+ DomainQueryKey = "domain"
)
// Module implements the ClientAPIModule interface for admin-related actions (reports, emojis, etc)
@@ -90,6 +93,7 @@ func (m *Module) Route(r router.Router) error {
r.AttachHandler(http.MethodDelete, DomainBlocksPathWithID, m.DomainBlockDELETEHandler)
r.AttachHandler(http.MethodPost, AccountsActionPath, m.AccountActionPOSTHandler)
r.AttachHandler(http.MethodPost, MediaCleanupPath, m.MediaCleanupPOSTHandler)
+ r.AttachHandler(http.MethodPost, MediaRefetchPath, m.MediaRefetchPOSTHandler)
r.AttachHandler(http.MethodGet, EmojiCategoriesPath, m.EmojiCategoriesGETHandler)
return nil
}