diff options
author | Puyodead1 <puyodead@proton.me> | 2023-03-25 12:49:26 -0400 |
---|---|---|
committer | Puyodead1 <puyodead@proton.me> | 2023-04-13 15:33:03 -0400 |
commit | c97ce59a0a835c051b9918ca268e9e67c690e9f8 (patch) | |
tree | 89330b19321bbb3626173b812a764473728b459e | |
parent | oapi: sticker packs (diff) | |
download | server-c97ce59a0a835c051b9918ca268e9e67c690e9f8.tar.xz |
oapi: stickers
-rw-r--r-- | assets/openapi.json | 11 | ||||
-rw-r--r-- | src/api/routes/stickers/#sticker_id/index.ts | 22 |
2 files changed, 25 insertions, 8 deletions
diff --git a/assets/openapi.json b/assets/openapi.json index 9a2b522f..bc43189a 100644 --- a/assets/openapi.json +++ b/assets/openapi.json @@ -7882,8 +7882,15 @@ } ], "responses": { - "default": { - "description": "No description available" + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Sticker" + } + } + } } }, "parameters": [ diff --git a/src/api/routes/stickers/#sticker_id/index.ts b/src/api/routes/stickers/#sticker_id/index.ts index 360149b5..2ea81bf9 100644 --- a/src/api/routes/stickers/#sticker_id/index.ts +++ b/src/api/routes/stickers/#sticker_id/index.ts @@ -16,15 +16,25 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Sticker } from "@spacebar/util"; -import { Router, Request, Response } from "express"; import { route } from "@spacebar/api"; +import { Sticker } from "@spacebar/util"; +import { Request, Response, Router } from "express"; const router = Router(); -router.get("/", route({}), async (req: Request, res: Response) => { - const { sticker_id } = req.params; +router.get( + "/", + route({ + responses: { + 200: { + body: "Sticker", + }, + }, + }), + async (req: Request, res: Response) => { + const { sticker_id } = req.params; - res.json(await Sticker.find({ where: { id: sticker_id } })); -}); + res.json(await Sticker.find({ where: { id: sticker_id } })); + }, +); export default router; |