Commit e1d27bac authored by jan.koester's avatar jan.koester
Browse files

test

parent b7064bb0
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -404,13 +404,17 @@ void blogi::Blogi::api(libhttppp::HttpRequest& curreq, const int tid){
                    json_object *params = nullptr;
                    json_object_object_get_ex(single_request, "params", &params);

                    std::string renderedHtml;
                    json_object *html_obj = nullptr;
                    if (json_object_object_get_ex(single_request, "html", &html_obj)) {
                        const char *h = json_object_get_string(html_obj);
                        if (h) renderedHtml = h;
                    }

                    bool found = false;
                    for (const Plugin::PluginData *curplg = BlogiPlg->getFirstPlugin(); curplg; curplg = curplg->getNextPlg()) {
                        PluginApi *api = curplg->getInstace();
                        if (api && api->canPublish() && api->getName() == targetPlugin) {
                            // For API-only publish: the rendered HTML is not provided here,
                            // the plugin should use an empty string or handle accordingly
                            std::string renderedHtml;
                            api->Publish(tid, renderedHtml, params, single_response);
                            found = true;
                            break;