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:
parent
a1d8869271
commit
ad5f5cb90d
@ -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": [
|
||||
|
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/>.
|
||||
*/
|
||||
|
||||
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";
|
||||
|
Loading…
Reference in New Issue
Block a user