unified export dialog, WIP

This commit is contained in:
azivner
2018-11-24 14:44:56 +01:00
parent 3e351bd8d3
commit ee23bcc783
12 changed files with 203 additions and 103 deletions

View File

@@ -9,14 +9,15 @@ const repository = require("../../services/repository");
async function exportNote(req, res) {
// entityId maybe either noteId or branchId depending on format
const entityId = req.params.entityId;
const type = req.params.type;
const format = req.params.format;
if (format === 'native-tar') {
await nativeTarExportService.exportToTar(await repository.getBranch(entityId), res);
}
else if (format === 'markdown-tar') {
await markdownTarExportService.exportToMarkdown(await repository.getBranch(entityId), res);
if (type === 'tar') {
await nativeTarExportService.exportToTar(await repository.getBranch(entityId), format, res);
}
// else if (format === 'tar') {
// await markdownTarExportService.exportToMarkdown(await repository.getBranch(entityId), res);
// }
// export single note without subtree
else if (format === 'markdown-single') {
await markdownSingleExportService.exportSingleMarkdown(await repository.getNote(entityId), res);