1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 20:52:42 +01:00

📝 add default route description to all routes

This commit is contained in:
Flam3rboy 2021-09-18 01:49:17 +02:00
parent 859fdd679b
commit 54412a3364
10 changed files with 28 additions and 21 deletions

View File

@ -1,8 +1,9 @@
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { route } from "@fosscord/api";
const router: Router = Router(); const router: Router = Router();
router.get("/", async (req: Request, res: Response) => { router.get("/", route({}), async (req: Request, res: Response) => {
//TODO //TODO
res.json([]).status(200); res.json([]).status(200);
}); });

View File

@ -5,7 +5,7 @@ import { route } from "@fosscord/api";
import { ChannelModifySchema } from "../../channels/#channel_id"; import { ChannelModifySchema } from "../../channels/#channel_id";
const router = Router(); const router = Router();
router.get("/", async (req: Request, res: Response) => { router.get("/", route({}), async (req: Request, res: Response) => {
const { guild_id } = req.params; const { guild_id } = req.params;
const channels = await Channel.find({ guild_id }); const channels = await Channel.find({ guild_id });

View File

@ -29,7 +29,7 @@ export type RolePositionUpdateSchema = {
position: number; position: number;
}[]; }[];
router.get("/", async (req: Request, res: Response) => { router.get("/", route({}), async (req: Request, res: Response) => {
const guild_id = req.params.guild_id; const guild_id = req.params.guild_id;
await Member.IsInGuildOrFail(req.user_id, guild_id); await Member.IsInGuildOrFail(req.user_id, guild_id);

View File

@ -1,8 +1,9 @@
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { route } from "@fosscord/api";
const router: Router = Router(); const router: Router = Router();
router.get("/", async (req: Request, res: Response) => { router.get("/", route({}), async (req: Request, res: Response) => {
//TODO //TODO
res.json([]).status(200); res.json([]).status(200);
}); });

View File

@ -1,8 +1,9 @@
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { route } from "@fosscord/api";
const router: Router = Router(); const router: Router = Router();
router.get("/applications/:id", async (req: Request, res: Response) => { router.get("/applications/:id", route({}), async (req: Request, res: Response) => {
//TODO //TODO
const { id } = req.params; const { id } = req.params;
res.json([]).status(200); res.json([]).status(200);

View File

@ -1,8 +1,9 @@
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { route } from "@fosscord/api";
const router: Router = Router(); const router: Router = Router();
router.get("/skus/:id", async (req: Request, res: Response) => { router.get("/skus/:id", route({}), async (req: Request, res: Response) => {
//TODO //TODO
const { id } = req.params; const { id } = req.params;
res.json([]).status(200); res.json([]).status(200);

View File

@ -1,8 +1,9 @@
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { route } from "@fosscord/api";
const router: Router = Router(); const router: Router = Router();
router.get("/", async (req: Request, res: Response) => { router.get("/", route({}), async (req: Request, res: Response) => {
//TODO //TODO
res.json([]).status(200); res.json([]).status(200);
}); });

View File

@ -1,10 +1,11 @@
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { route } from "@fosscord/api";
const router: Router = Router(); const router: Router = Router();
router.get("/", async (req: Request, res: Response) => { router.get("/", route({}), async (req: Request, res: Response) => {
//TODO //TODO
res.json({ "country_code": "US" }).status(200); res.json({ country_code: "US" }).status(200);
}); });
export default router; export default router;

View File

@ -1,8 +1,9 @@
import { Request, Response, Router } from "express"; import { Request, Response, Router } from "express";
import { route } from "@fosscord/api";
const router: Router = Router(); const router: Router = Router();
router.get("/", async (req: Request, res: Response) => { router.get("/", route({}), async (req: Request, res: Response) => {
//TODO //TODO
res.json([]).status(200); res.json([]).status(200);
}); });

View File

@ -23,7 +23,7 @@ export interface UserModifySchema {
code?: string; code?: string;
} }
router.get("/", async (req: Request, res: Response) => { router.get("/", route({}), async (req: Request, res: Response) => {
res.json(await User.findOne({ select: PrivateUserProjection, where: { id: req.user_id } })); res.json(await User.findOne({ select: PrivateUserProjection, where: { id: req.user_id } }));
}); });