Commit 5ddea51c authored by jan.koester's avatar jan.koester
Browse files

test

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

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

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

@@ -2185,7 +2186,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(tpl.name.c_str()));
                json_object_object_add(conflictObj, "name", json_object_new_string(generatedName.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)));
@@ -2202,7 +2203,7 @@ void webedit::Api::handleTemplateBulkGenerate(libhttppp::HttpRequest &curreq,
            if (exists && overwriteExisting) {
                changedDocId = _db.updateDocument(uid,
                                                  existingDocId,
                                                  tpl.name,
                                                  generatedName,
                                                  generatedXml,
                                                  author,
                                                  targetGroup);
@@ -2210,7 +2211,7 @@ void webedit::Api::handleTemplateBulkGenerate(libhttppp::HttpRequest &curreq,
            } else {
                changedDocId = _db.saveDocument(uid,
                                                sessionDomain,
                                                tpl.name,
                                                generatedName,
                                                generatedXml,
                                                author,
                                                targetGroup);
@@ -2220,7 +2221,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(tpl.name.c_str()));
                json_object_object_add(createdObj, "name", json_object_new_string(generatedName.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)));