1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 04:32:35 +01:00

oapi: sticker packs

This commit is contained in:
Puyodead1 2023-03-25 12:48:09 -04:00
parent a1d8869271
commit ad5f5cb90d
No known key found for this signature in database
GPG Key ID: A4FA4FEC0DD353FC
5 changed files with 3802 additions and 7 deletions

View File

@ -6503,6 +6503,12 @@
"location"
]
},
"StickerPacksResponse": {
"type": "array",
"items": {
"$ref": "#/components/schemas/StickerPack"
}
},
"TenorTrendingResponse": {
"type": "object",
"properties": {
@ -7904,8 +7910,15 @@
}
],
"responses": {
"default": {
"description": "No description available"
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StickerPacksResponse"
}
}
}
}
},
"tags": [

File diff suppressed because it is too large Load Diff

View File

@ -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;

View File

@ -0,0 +1,3 @@
import { StickerPack } from "../../entities";
export type StickerPacksResponse = StickerPack[];

View File

@ -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";