Syndicate JSON request

This commit is contained in:
2023-01-29 13:01:15 +11:00
parent 93fc63207d
commit ce479f8f41

View File

@@ -51,7 +51,6 @@ module Adamantium
new_params[:h] = "entry" new_params[:h] = "entry"
new_params[:post_type] = post_type new_params[:post_type] = post_type
new_params[:action] = params[:action] new_params[:action] = params[:action]
new_params[:syndicate_to] = params[:"mp-syndicate-to"]&.split(",") || []
publish_time = params[:published_at] || Time.now 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[:name] = params[:properties][:name] && params[:properties][:name].first
new_params[:content] = params[:properties][:content]&.first&.tr("\n", " ") new_params[:content] = params[:properties][:content]&.first&.tr("\n", " ")
new_params[:slug] = params[:slug] || params["mp-slug"] new_params[:slug] = params[:slug] || params["mp-slug"]
new_params[:syndicate_to] = params[:properties][:"mp-syndicate-to"] || []
else else
new_params[:syndicate_to] = params[:"mp-syndicate-to"]&.split(",") || []
new_params[:name] = params[:name] new_params[:name] = params[:name]
new_params[:slug] = params[:slug] || params["mp-slug"] new_params[:slug] = params[:slug] || params["mp-slug"]
new_params[:published_at] = (params[:"post-status"] == "draft") ? nil : publish_time new_params[:published_at] = (params[:"post-status"] == "draft") ? nil : publish_time