oapi: sticker packs
This commit is contained in:
parent
a1d8869271
commit
ad5f5cb90d
@ -6503,6 +6503,12 @@
|
|||||||
"location"
|
"location"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"StickerPacksResponse": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/StickerPack"
|
||||||
|
}
|
||||||
|
},
|
||||||
"TenorTrendingResponse": {
|
"TenorTrendingResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -7904,8 +7910,15 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"default": {
|
"200": {
|
||||||
"description": "No description available"
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/StickerPacksResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
|
3766
assets/schemas.json
3766
assets/schemas.json
File diff suppressed because it is too large
Load Diff
@ -16,16 +16,28 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Request, Response, Router } from "express";
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { StickerPack } from "@spacebar/util";
|
import { StickerPack } from "@spacebar/util";
|
||||||
|
import { Request, Response, Router } from "express";
|
||||||
|
|
||||||
const router: Router = Router();
|
const router: Router = Router();
|
||||||
|
|
||||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
router.get(
|
||||||
const sticker_packs = await StickerPack.find({ relations: ["stickers"] });
|
"/",
|
||||||
|
route({
|
||||||
res.json({ sticker_packs });
|
responses: {
|
||||||
|
200: {
|
||||||
|
body: "StickerPacksResponse",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
async (req: Request, res: Response) => {
|
||||||
|
const sticker_packs = await StickerPack.find({
|
||||||
|
relations: ["stickers"],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
res.json({ sticker_packs });
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
export default router;
|
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 "./LocationMetadataResponse";
|
||||||
export * from "./MemberJoinGuildResponse";
|
export * from "./MemberJoinGuildResponse";
|
||||||
export * from "./OAuthAuthorizeResponse";
|
export * from "./OAuthAuthorizeResponse";
|
||||||
|
export * from "./StickerPacksResponse";
|
||||||
export * from "./Tenor";
|
export * from "./Tenor";
|
||||||
export * from "./TokenResponse";
|
export * from "./TokenResponse";
|
||||||
export * from "./UserProfileResponse";
|
export * from "./UserProfileResponse";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user