Refactored a bit the code; the original code was too experimental in style.
This commit is contained in:
1 parent
f7a8d494f5
commit
bbd705ee3b
3 files changed
+55
-60
No files matched your search
+1
-1
@@ -30,7 +30,7 @@ function getFileHandlerFactory(fileService: FileService): Handler {
|
||||
return async (ctx: Context) => {
|
||||
const untypedCtx: any = ctx;
|
||||
const fileId = untypedCtx.params.path;
|
||||
const reader = await fileService.getBodyAsReader(fileId);
|
||||
const reader = await fileService.getContentAsReader(fileId);
|
||||
if(reader == null){
|
||||
ctx.response.status = 404;
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user