changes in API format

This commit is contained in:
azivner
2018-04-01 20:33:10 -04:00
parent 311952d4dd
commit a066c6fe2b
18 changed files with 79 additions and 91 deletions

View File

@@ -86,18 +86,18 @@ async function parseImportFile(file) {
}
async function importTar(req) {
const parentNoteId = req.params.parentNoteId;
const noteId = req.params.noteId;
const file = req.file;
const parentNote = await repository.getNote(parentNoteId);
const parentNote = await repository.getNote(noteId);
if (!parentNote) {
return [404, `Note ${parentNoteId} doesn't exist.`];
return [404, `Note ${noteId} doesn't exist.`];
}
const files = await parseImportFile(file);
await importNotes(files, parentNoteId);
await importNotes(files, noteId);
}
async function importNotes(files, parentNoteId) {