From ce479f8f41e656d4e9b6c95f54e54e760ae92158 Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Sun, 29 Jan 2023 13:01:15 +1100 Subject: [PATCH] Syndicate JSON request --- lib/adamantium/micropub_request_parser.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/adamantium/micropub_request_parser.rb b/lib/adamantium/micropub_request_parser.rb index f380e9e..ad67793 100644 --- a/lib/adamantium/micropub_request_parser.rb +++ b/lib/adamantium/micropub_request_parser.rb @@ -51,7 +51,6 @@ module Adamantium new_params[:h] = "entry" new_params[:post_type] = post_type new_params[:action] = params[:action] - new_params[:syndicate_to] = params[:"mp-syndicate-to"]&.split(",") || [] publish_time = params[:published_at] || Time.now @@ -61,8 +60,10 @@ module Adamantium new_params[:name] = params[:properties][:name] && params[:properties][:name].first new_params[:content] = params[:properties][:content]&.first&.tr("\n", " ") new_params[:slug] = params[:slug] || params["mp-slug"] + new_params[:syndicate_to] = params[:properties][:"mp-syndicate-to"] || [] else + new_params[:syndicate_to] = params[:"mp-syndicate-to"]&.split(",") || [] new_params[:name] = params[:name] new_params[:slug] = params[:slug] || params["mp-slug"] new_params[:published_at] = (params[:"post-status"] == "draft") ? nil : publish_time