Merge branch 'stable' into next61

# Conflicts:
#	src/etapi/etapi.openapi.yaml
#	src/etapi/notes.js
#	src/public/app/widgets/type_widgets/editable_text.js
#	src/services/app_info.js
This commit is contained in:
zadam
2023-06-20 23:30:45 +02:00
12 changed files with 86 additions and 37 deletions

View File

@@ -8,6 +8,7 @@ const v = require("./validators");
const searchService = require("../services/search/services/search");
const SearchContext = require("../services/search/search_context");
const zipExportService = require("../services/export/zip");
const zipImportService = require("../services/import/zip");
function register(router) {
eu.route(router, 'get', '/etapi/notes', (req, res, next) => {
@@ -151,6 +152,18 @@ function register(router) {
zipExportService.exportToZip(taskContext, branch, format, res);
});
eu.route(router, 'post' ,'/etapi/notes/:noteId/import', (req, res, next) => {
const note = eu.getAndCheckNote(req.params.noteId);
const taskContext = new TaskContext('no-progress-reporting');
zipImportService.importZip(taskContext, req.body, note).then(importedNote => {
res.status(201).json({
note: mappers.mapNoteToPojo(importedNote),
branch: mappers.mapBranchToPojo(importedNote.getBranches()[0]),
});
}); // we need better error handling here, async errors won't be properly processed.
});
eu.route(router, 'post' ,'/etapi/notes/:noteId/revision', (req, res, next) => {
const note = eu.getAndCheckNote(req.params.noteId);