mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-18 12:27:28 -06:00
[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
This commit is contained in:
parent
62d4d756d3
commit
caa0cde0e0
11 changed files with 231 additions and 1 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue