oapi: sticker packs
This commit is contained in:
parent
a1d8869271
commit
ad5f5cb90d
Binary file not shown.
Binary file not shown.
@ -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;
|
||||
|
||||
3
src/util/schemas/responses/StickerPacksResponse.ts
Normal file
3
src/util/schemas/responses/StickerPacksResponse.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import { StickerPack } from "../../entities";
|
||||
|
||||
export type StickerPacksResponse = StickerPack[];
|
||||
@ -36,6 +36,7 @@ export * from "./LimitsConfigurationResponse";
|
||||
export * from "./LocationMetadataResponse";
|
||||
export * from "./MemberJoinGuildResponse";
|
||||
export * from "./OAuthAuthorizeResponse";
|
||||
export * from "./StickerPacksResponse";
|
||||
export * from "./Tenor";
|
||||
export * from "./TokenResponse";
|
||||
export * from "./UserProfileResponse";
|
||||
|
||||
Reference in New Issue
Block a user