mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-15 05:13:01 -06:00
[feature] Implement profile API (#2926)
* Implement profile API This Mastodon 4.2 extension provides capabilities missing from the existing Mastodon account update API: deleting an account's avatar or header. See: https://docs.joinmastodon.org/methods/profile/ * Move profile media methods to media processor * Remove check for moved account
This commit is contained in:
parent
f9a4a6120d
commit
975e92b7f1
6 changed files with 405 additions and 1 deletions
|
|
@ -56,6 +56,11 @@ const (
|
|||
MovePath = BasePath + "/move"
|
||||
AliasPath = BasePath + "/alias"
|
||||
ThemesPath = BasePath + "/themes"
|
||||
|
||||
// ProfileBasePath for the profile API, an extension of the account update API with a different path.
|
||||
ProfileBasePath = "/v1/profile"
|
||||
AvatarPath = ProfileBasePath + "/avatar"
|
||||
HeaderPath = ProfileBasePath + "/header"
|
||||
)
|
||||
|
||||
type Module struct {
|
||||
|
|
@ -84,6 +89,10 @@ func (m *Module) Route(attachHandler func(method string, path string, f ...gin.H
|
|||
// modify account
|
||||
attachHandler(http.MethodPatch, UpdatePath, m.AccountUpdateCredentialsPATCHHandler)
|
||||
|
||||
// modify account profile media
|
||||
attachHandler(http.MethodDelete, AvatarPath, m.AccountAvatarDELETEHandler)
|
||||
attachHandler(http.MethodDelete, HeaderPath, m.AccountHeaderDELETEHandler)
|
||||
|
||||
// get account's statuses
|
||||
attachHandler(http.MethodGet, StatusesPath, m.AccountStatusesGETHandler)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue