mirror of
https://github.com/spacebarchat/server.git
synced 2026-07-28 14:09:32 +00:00
oapi: sticker packs
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user