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:
parent
859fdd679b
commit
54412a3364
@ -1,8 +1,9 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { route } from "@fosscord/api";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
router.get("/", async (req: Request, res: Response) => {
|
||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||
//TODO
|
||||
res.json([]).status(200);
|
||||
});
|
||||
|
@ -5,7 +5,7 @@ import { route } from "@fosscord/api";
|
||||
import { ChannelModifySchema } from "../../channels/#channel_id";
|
||||
const router = Router();
|
||||
|
||||
router.get("/", async (req: Request, res: Response) => {
|
||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||
const { guild_id } = req.params;
|
||||
const channels = await Channel.find({ guild_id });
|
||||
|
||||
|
@ -29,7 +29,7 @@ export type RolePositionUpdateSchema = {
|
||||
position: number;
|
||||
}[];
|
||||
|
||||
router.get("/", async (req: Request, res: Response) => {
|
||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||
const guild_id = req.params.guild_id;
|
||||
|
||||
await Member.IsInGuildOrFail(req.user_id, guild_id);
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { route } from "@fosscord/api";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
router.get("/", async (req: Request, res: Response) => {
|
||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||
//TODO
|
||||
res.json([]).status(200);
|
||||
});
|
||||
|
@ -1,10 +1,11 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { route } from "@fosscord/api";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
router.get("/applications/:id", async (req: Request, res: Response) => {
|
||||
router.get("/applications/:id", route({}), async (req: Request, res: Response) => {
|
||||
//TODO
|
||||
const { id } = req.params;
|
||||
const { id } = req.params;
|
||||
res.json([]).status(200);
|
||||
});
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { route } from "@fosscord/api";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
router.get("/skus/:id", async (req: Request, res: Response) => {
|
||||
router.get("/skus/:id", route({}), async (req: Request, res: Response) => {
|
||||
//TODO
|
||||
const { id } = req.params;
|
||||
const { id } = req.params;
|
||||
res.json([]).status(200);
|
||||
});
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { route } from "@fosscord/api";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
router.get("/", async (req: Request, res: Response) => {
|
||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||
//TODO
|
||||
res.json([]).status(200);
|
||||
});
|
||||
|
@ -1,10 +1,11 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { route } from "@fosscord/api";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
router.get("/", async (req: Request, res: Response) => {
|
||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||
//TODO
|
||||
res.json({ "country_code": "US" }).status(200);
|
||||
res.json({ country_code: "US" }).status(200);
|
||||
});
|
||||
|
||||
export default router;
|
@ -1,8 +1,9 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { route } from "@fosscord/api";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
router.get("/", async (req: Request, res: Response) => {
|
||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||
//TODO
|
||||
res.json([]).status(200);
|
||||
});
|
||||
|
@ -23,7 +23,7 @@ export interface UserModifySchema {
|
||||
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 } }));
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user