mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-15 01:57:29 -06:00
[feature] Add emoji DELETE handler at /api/v1/admin/custom_emojis (#913)
* add emoji DELETE handler * no need to process error (thanks kim) * don't double check if user is admin * add missing security annotation
This commit is contained in:
parent
6a95f5fa67
commit
f7416d6e94
11 changed files with 369 additions and 0 deletions
|
|
@ -38,6 +38,17 @@ func (suite *EmojiTestSuite) TestGetUseableEmojis() {
|
|||
suite.Equal("rainbow", emojis[0].Shortcode)
|
||||
}
|
||||
|
||||
func (suite *EmojiTestSuite) TestDeleteEmojiByID() {
|
||||
testEmoji := suite.testEmojis["rainbow"]
|
||||
|
||||
err := suite.db.DeleteEmojiByID(context.Background(), testEmoji.ID)
|
||||
suite.NoError(err)
|
||||
|
||||
dbEmoji, err := suite.db.GetEmojiByID(context.Background(), testEmoji.ID)
|
||||
suite.Nil(dbEmoji)
|
||||
suite.ErrorIs(err, db.ErrNoEntries)
|
||||
}
|
||||
|
||||
func (suite *EmojiTestSuite) TestGetEmojiByStaticURL() {
|
||||
emoji, err := suite.db.GetEmojiByStaticURL(context.Background(), "http://localhost:8080/fileserver/01F8MH17FWEB39HZJ76B6VXSKF/emoji/static/01F8MH9H8E4VG3KDYJR9EGPXCQ.png")
|
||||
suite.NoError(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue