✨ Able to get sticker pack by id
This commit is contained in:
@ -26,6 +26,7 @@ func MapAPIs(app *fiber.App, baseURL string) {
|
||||
api.Get("/stickers/lookup", lookupStickerBatch)
|
||||
api.Get("/stickers/lookup/:alias", lookupSticker)
|
||||
api.Get("/stickers/packs", listStickerPacks)
|
||||
api.Get("/stickers/packs/:packId", getStickerPack)
|
||||
api.Post("/stickers/packs", createStickerPack)
|
||||
api.Put("/stickers/packs/:packId", updateStickerPack)
|
||||
api.Delete("/stickers/packs/:packId", deleteStickerPack)
|
||||
|
@ -44,6 +44,16 @@ func listStickerPacks(c *fiber.Ctx) error {
|
||||
})
|
||||
}
|
||||
|
||||
func getStickerPack(c *fiber.Ctx) error {
|
||||
id, _ := c.ParamsInt("packId", 0)
|
||||
pack, err := services.GetStickerPack(uint(id))
|
||||
if err != nil {
|
||||
return fiber.NewError(fiber.StatusNotFound, err.Error())
|
||||
}
|
||||
|
||||
return c.JSON(pack)
|
||||
}
|
||||
|
||||
func createStickerPack(c *fiber.Ctx) error {
|
||||
if err := gap.H.EnsureAuthenticated(c); err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user