start refactoring return codes from fedi endpoints, remove some cruft

This commit is contained in:
tobi 2025-10-08 13:14:06 +02:00
commit 47051a26d6
28 changed files with 346 additions and 291 deletions

View file

@ -30,7 +30,7 @@ import (
// StatusGETHandler serves the target status as an activitystreams NOTE so that other AP servers can parse it.
func (m *Module) StatusGETHandler(c *gin.Context) {
// usernames on our instance are always lowercase
requestedUsername := strings.ToLower(c.Param(UsernameKey))
requestedUsername := strings.ToLower(c.Param(apiutil.UsernameKey))
if requestedUsername == "" {
err := errors.New("no username specified in request")
apiutil.ErrorHandler(c, gtserror.NewErrorBadRequest(err, err.Error()), m.processor.InstanceGetV1)
@ -38,7 +38,7 @@ func (m *Module) StatusGETHandler(c *gin.Context) {
}
// status IDs on our instance are always uppercase
requestedStatusID := strings.ToUpper(c.Param(StatusIDKey))
requestedStatusID := strings.ToUpper(c.Param(apiutil.IDKey))
if requestedStatusID == "" {
err := errors.New("no status id specified in request")
apiutil.ErrorHandler(c, gtserror.NewErrorBadRequest(err, err.Error()), m.processor.InstanceGetV1)