diff --git a/apps/juxtaposition-ui/src/services/juxt-web/routes/console/posts.tsx b/apps/juxtaposition-ui/src/services/juxt-web/routes/console/posts.tsx index 9aeeb618..977c1a49 100644 --- a/apps/juxtaposition-ui/src/services/juxt-web/routes/console/posts.tsx +++ b/apps/juxtaposition-ui/src/services/juxt-web/routes/console/posts.tsx @@ -341,6 +341,10 @@ async function newPost(req: Request, res: Response): Promise { return; } else { community = await database.getCommunityByID(parentPost.community_id); + if (parentPost.removed) { + res.sendStatus(400); + return; + } } } if (params.post_id && (body.body === '' && body.painting === '' && body.screenshot === '')) { diff --git a/apps/miiverse-api/src/services/api/routes/posts.ts b/apps/miiverse-api/src/services/api/routes/posts.ts index 108da34e..e79e95cb 100644 --- a/apps/miiverse-api/src/services/api/routes/posts.ts +++ b/apps/miiverse-api/src/services/api/routes/posts.ts @@ -291,6 +291,10 @@ async function newPost(request: express.Request, response: express.Response): Pr olive_community_id: parentPost.community_id }); } + if (parentPost.removed) { + request.log.warn('Request wants to reply to parent post, but parent post has been removed'); + return badRequest(response, ApiErrorCode.BAD_PARAMS); + } } }