diff options
author | 2022-05-20 04:34:36 -0400 | |
---|---|---|
committer | 2022-05-20 10:34:36 +0200 | |
commit | caa0cde0e025708a762659758d9de7851745cbfe (patch) | |
tree | 49ff2f70b5a15a3bf73832c8032ce7f4d5023392 /internal/api | |
parent | [bugfix] Stop some statuses from being home timelined when they shouldn't be ... (diff) | |
download | gotosocial-caa0cde0e025708a762659758d9de7851745cbfe.tar.xz |
[feature] implement custom_emojis endpoint (#563)
* implement custom_emojis api endpoint
* add tests for getting custom emoji out of the database and converting to api emoji
* change sort direction of emoji query
* change logging level and initialize array with known length as per kim's suggestions
* add continue to lessen risk of making a malformed struct during conversion from db to api emojis
Diffstat (limited to 'internal/api')
-rw-r--r-- | internal/api/client/emoji/emojisget.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/api/client/emoji/emojisget.go b/internal/api/client/emoji/emojisget.go index 62223e992..0b8c510eb 100644 --- a/internal/api/client/emoji/emojisget.go +++ b/internal/api/client/emoji/emojisget.go @@ -14,5 +14,11 @@ func (m *Module) EmojisGETHandler(c *gin.Context) { return } - c.JSON(http.StatusOK, []string{}) + emojis, errWithCode := m.processor.CustomEmojisGet(c) + if errWithCode != nil { + c.JSON(errWithCode.Code(), gin.H{"error": errWithCode.Safe()}) + return + } + + c.JSON(http.StatusOK, emojis) } |