don't render deleted content

This commit is contained in:
monoid 2021-01-15 20:20:23 +09:00
parent cfd3e25952
commit 90d329cfd8

View File

@ -122,6 +122,9 @@ const ContentHandler = (controller : DocumentAccessor) => async (ctx:Context, ne
if (document == undefined){ if (document == undefined){
return sendError(404,"document does not exist."); return sendError(404,"document does not exist.");
} }
if(document.deleted_at !== null){
return sendError(404,"document has been removed.");
}
const path = join(document.basepath,document.filename); const path = join(document.basepath,document.filename);
ctx.state['location'] = { ctx.state['location'] = {
path:path, path:path,