From caa0cde0e025708a762659758d9de7851745cbfe Mon Sep 17 00:00:00 2001 From: Adelie Paull <1208865+i-am-a-paull@users.noreply.github.com> Date: Fri, 20 May 2022 04:34:36 -0400 Subject: [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 --- internal/api/client/emoji/emojisget.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'internal/api') 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) } -- cgit v1.2.3