summaryrefslogtreecommitdiff
path: root/internal/api/client/account/accountget.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-04-15 14:33:01 +0200
committerLibravatar GitHub <noreply@github.com>2022-04-15 14:33:01 +0200
commit26683b3d49beea9b1f0e8f78df4720285d4c0825 (patch)
tree06bf09cdee7a60c41947a0bd03d6a42ad83ee784 /internal/api/client/account/accountget.go
parent[bugfix] Fix broken only_media and only_public flags on /api/v1/accounts/:id/... (diff)
downloadgotosocial-26683b3d49beea9b1f0e8f78df4720285d4c0825.tar.xz
[feature] Web profile pages for accounts (#449)
* add default avatars * allow webModule to error * return errWithCode from account get * add AccountGetLocalByUsername * check nil requesting account * add timestampShort function for just month/year * move loading logic to New + add default avatars * add profile page view * update swagger docs * add excludeReblogs to GetAccountStatuses * ignore casing when selecting local account by username * appropriate redirects * css fiddling * add 'about' heading * adjust thread page to work with routing * return AP representation if requested + authorized * simplify auth check * go fmt * golangci-lint ignore math/rand
Diffstat (limited to 'internal/api/client/account/accountget.go')
-rw-r--r--internal/api/client/account/accountget.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/api/client/account/accountget.go b/internal/api/client/account/accountget.go
index 6085d2d3e..1fa7014eb 100644
--- a/internal/api/client/account/accountget.go
+++ b/internal/api/client/account/accountget.go
@@ -22,6 +22,7 @@ import (
"net/http"
"github.com/gin-gonic/gin"
+ "github.com/sirupsen/logrus"
"github.com/superseriousbusiness/gotosocial/internal/api"
"github.com/superseriousbusiness/gotosocial/internal/oauth"
)
@@ -76,9 +77,10 @@ func (m *Module) AccountGETHandler(c *gin.Context) {
return
}
- acctInfo, err := m.processor.AccountGet(c.Request.Context(), authed, targetAcctID)
+ acctInfo, errWithCode := m.processor.AccountGet(c.Request.Context(), authed, targetAcctID)
if err != nil {
- c.JSON(http.StatusNotFound, gin.H{"error": "not found"})
+ logrus.Debug(errWithCode.Error())
+ c.JSON(errWithCode.Code(), gin.H{"error": errWithCode.Safe()})
return
}