v3: follows, notifications, invite-only registration, unread markers
This commit is contained in:
@@ -31,14 +31,16 @@ router.get("/dumps/:dumpId/comments", async (ctx) => {
|
||||
}
|
||||
const dump = getDump(ctx.params.dumpId, requestingUserId);
|
||||
const comments = getComments(dump.id);
|
||||
const responseBody: APIResponse<Comment[]> = { success: true, data: comments };
|
||||
const responseBody: APIResponse<Comment[]> = {
|
||||
success: true,
|
||||
data: comments,
|
||||
};
|
||||
ctx.response.body = responseBody;
|
||||
});
|
||||
|
||||
// POST /api/dumps/:dumpId/comments — auth required
|
||||
router.post("/dumps/:dumpId/comments", authMiddleware, async (ctx) => {
|
||||
const userId = ctx.state.user.userId as string;
|
||||
const isAdmin = (ctx.state.user.isAdmin ?? false) as boolean;
|
||||
const dump = getDump(ctx.params.dumpId, userId);
|
||||
const body = await ctx.request.body.json();
|
||||
if (!isCreateCommentRequest(body)) {
|
||||
|
||||
Reference in New Issue
Block a user