[feature] Account alias / move API + db models (#2518)

* [feature] Account alias / move API + db models

* go fmt

* fix little cherry-pick issues

* update error checking, formatting

* add and use new util functions to simplify alias logic
This commit is contained in:
tobi
2024-01-16 17:22:44 +01:00
committed by GitHub
parent ebf550b7c1
commit c36f9ac37b
23 changed files with 1243 additions and 39 deletions

View File

@@ -53,6 +53,8 @@ const (
UnfollowPath = BasePathWithID + "/unfollow"
UpdatePath = BasePath + "/update_credentials"
VerifyPath = BasePath + "/verify_credentials"
MovePath = BasePath + "/move"
AliasPath = BasePath + "/alias"
)
type Module struct {
@@ -108,4 +110,8 @@ func (m *Module) Route(attachHandler func(method string, path string, f ...gin.H
// search for accounts
attachHandler(http.MethodGet, SearchPath, m.AccountSearchGETHandler)
attachHandler(http.MethodGet, LookupPath, m.AccountLookupGETHandler)
// migration handlers
attachHandler(http.MethodPost, AliasPath, m.AccountAliasPOSTHandler)
attachHandler(http.MethodPost, MovePath, m.AccountMovePOSTHandler)
}