mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-02-18 04:08:51 -06:00
camel casing and fixes
This commit is contained in:
@@ -26,8 +26,8 @@ async function uploadFile(req) {
|
||||
mime: file.mimetype
|
||||
});
|
||||
|
||||
await labelService.createLabel(note.noteId, "original_file_name", originalName);
|
||||
await labelService.createLabel(note.noteId, "file_size", size);
|
||||
await labelService.createLabel(note.noteId, "originalFileName", originalName);
|
||||
await labelService.createLabel(note.noteId, "fileSize", size);
|
||||
|
||||
return {
|
||||
noteId: note.noteId
|
||||
@@ -48,7 +48,7 @@ async function downloadFile(req, res) {
|
||||
}
|
||||
|
||||
const labelMap = await note.getLabelMap();
|
||||
const fileName = labelMap.original_file_name ? labelMap.original_file_name : note.title;
|
||||
const fileName = labelMap.originalFileName || note.title;
|
||||
|
||||
res.setHeader('Content-Disposition', 'file; filename="' + fileName + '"');
|
||||
res.setHeader('Content-Type', note.mime);
|
||||
|
||||
@@ -54,7 +54,10 @@ async function protectBranch(req) {
|
||||
}
|
||||
|
||||
async function setNoteTypeMime(req) {
|
||||
const [noteId, type, mime] = req.params;
|
||||
// can't use [] destructuring because req.params is not iterable
|
||||
const noteId = req.params[0];
|
||||
const type = req.params[1];
|
||||
const mime = req.params[2];
|
||||
|
||||
const note = await repository.getNote(noteId);
|
||||
note.type = type;
|
||||
|
||||
Reference in New Issue
Block a user