diff options
author | Puyodead1 <puyodead@proton.me> | 2023-03-25 12:48:09 -0400 |
---|---|---|
committer | Puyodead1 <puyodead@proton.me> | 2023-04-13 15:32:37 -0400 |
commit | ad5f5cb90d8ff64ecc33bcd94e18a5f6b462b380 (patch) | |
tree | 58584de2d9b5bd182136adfa21def5297744e8fa /src/api | |
parent | oapi: readstates (diff) | |
download | server-ad5f5cb90d8ff64ecc33bcd94e18a5f6b462b380.tar.xz |
oapi: sticker packs
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/routes/sticker-packs/index.ts | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/api/routes/sticker-packs/index.ts b/src/api/routes/sticker-packs/index.ts index 234e03c6..627ce061 100644 --- a/src/api/routes/sticker-packs/index.ts +++ b/src/api/routes/sticker-packs/index.ts @@ -16,16 +16,28 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Request, Response, Router } from "express"; import { route } from "@spacebar/api"; import { StickerPack } from "@spacebar/util"; +import { Request, Response, Router } from "express"; const router: Router = Router(); -router.get("/", route({}), async (req: Request, res: Response) => { - const sticker_packs = await StickerPack.find({ relations: ["stickers"] }); +router.get( + "/", + route({ + responses: { + 200: { + body: "StickerPacksResponse", + }, + }, + }), + async (req: Request, res: Response) => { + const sticker_packs = await StickerPack.find({ + relations: ["stickers"], + }); - res.json({ sticker_packs }); -}); + res.json({ sticker_packs }); + }, +); export default router; |