prettier formatted /api

This commit is contained in:
developomp
2021-10-20 09:13:22 +09:00
parent b5c0ee7f30
commit 99f6da9762
60 changed files with 9112 additions and 10537 deletions
@@ -5,7 +5,7 @@ const router = Router();
router.get("/", route({}), (req: Request, res: Response) => {
// TODO:
res.json([]).status(200)
res.json([]).status(200);
});
export default router;
@@ -5,7 +5,7 @@ const router = Router();
router.get("/", route({}), (req: Request, res: Response) => {
// TODO:
res.json([]).status(200)
res.json([]).status(200);
});
export default router;
+5 -2
View File
@@ -5,8 +5,11 @@ import { route } from "@fosscord/api";
const router: Router = Router();
router.get("/", route({}), async (req: Request, res: Response) => {
const recipients = await Recipient.find({ where: { user_id: req.user_id, closed: false }, relations: ["channel", "channel.recipients"] });
res.json(await Promise.all(recipients.map(r => DmChannelDTO.from(r.channel, [req.user_id]))));
const recipients = await Recipient.find({
where: { user_id: req.user_id, closed: false },
relations: ["channel", "channel.recipients"]
});
res.json(await Promise.all(recipients.map((r) => DmChannelDTO.from(r.channel, [req.user_id]))));
});
export interface DmChannelCreateSchema {
+8 -7
View File
@@ -4,14 +4,15 @@ import { route } from "@fosscord/api";
const router = Router();
router.get("/", route({}), (req: Request, res: Response) => {
// TODO:
// TODO:
res.json({
categories: {
social: true,
communication: true,
tips: false,
updates_and_announcements: false,
recommendations_and_events: false },
categories: {
social: true,
communication: true,
tips: false,
updates_and_announcements: false,
recommendations_and_events: false
},
initialized: false
}).status(200);
});