Commit 1bd60c55 authored by jan.koester's avatar jan.koester
Browse files

test

parent ebe2d74c
Loading
Loading
Loading
Loading
+6 −7
Changes for editor/src/webedit_api.cpp: 6 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -2172,13 +2172,12 @@ void webedit::Api::handleTemplateBulkGenerate(libhttppp::HttpRequest &curreq,

        for (const auto &tpl : templates) {
            const std::string generatedXml = replacePlaceholders(tpl.xml, rowValues);
            const std::string generatedGroup = replacePlaceholders(tpl.group, rowValues);
            const std::string targetGroup = rowDomain.empty() ? generatedGroup : rowDomain;
            const std::string targetGroup = rowDomain.empty() ? tpl.group : rowDomain;

            std::string existingDocId;
            const bool exists = _db.findDocumentIdByNameGroup(uid,
                                                              sessionDomain,
                                                              generatedName,
                                                              tpl.name,
                                                              targetGroup,
                                                              existingDocId);

@@ -2186,7 +2185,7 @@ void webedit::Api::handleTemplateBulkGenerate(libhttppp::HttpRequest &curreq,
                ++conflictsCount;
                json_object *conflictObj = json_object_new_object();
                json_object_object_add(conflictObj, "id", json_object_new_string(existingDocId.c_str()));
                json_object_object_add(conflictObj, "name", json_object_new_string(generatedName.c_str()));
                json_object_object_add(conflictObj, "name", json_object_new_string(tpl.name.c_str()));
                json_object_object_add(conflictObj, "group", json_object_new_string(targetGroup.c_str()));
                json_object_object_add(conflictObj, "template_id", json_object_new_string(tpl.id.c_str()));
                json_object_object_add(conflictObj, "row_index", json_object_new_int64(static_cast<long long>(rowIndex)));
@@ -2203,7 +2202,7 @@ void webedit::Api::handleTemplateBulkGenerate(libhttppp::HttpRequest &curreq,
            if (exists && overwriteExisting) {
                changedDocId = _db.updateDocument(uid,
                                                  existingDocId,
                                                  generatedName,
                                                  tpl.name,
                                                  generatedXml,
                                                  author,
                                                  targetGroup);
@@ -2211,7 +2210,7 @@ void webedit::Api::handleTemplateBulkGenerate(libhttppp::HttpRequest &curreq,
            } else {
                changedDocId = _db.saveDocument(uid,
                                                sessionDomain,
                                                generatedName,
                                                tpl.name,
                                                generatedXml,
                                                author,
                                                targetGroup);
@@ -2221,7 +2220,7 @@ void webedit::Api::handleTemplateBulkGenerate(libhttppp::HttpRequest &curreq,
                ++createdCount;
                json_object *createdObj = json_object_new_object();
                json_object_object_add(createdObj, "id", json_object_new_string(changedDocId.c_str()));
                json_object_object_add(createdObj, "name", json_object_new_string(generatedName.c_str()));
                json_object_object_add(createdObj, "name", json_object_new_string(tpl.name.c_str()));
                json_object_object_add(createdObj, "group", json_object_new_string(targetGroup.c_str()));
                json_object_object_add(createdObj, "template_id", json_object_new_string(tpl.id.c_str()));
                json_object_object_add(createdObj, "row_index", json_object_new_int64(static_cast<long long>(rowIndex)));