lib/commonmeta/utils.rb in commonmeta-ruby-3.3.6 vs lib/commonmeta/utils.rb in commonmeta-ruby-3.3.7
- old
+ new
@@ -1471,11 +1471,11 @@
# Create the token (including decoding secret)
JWT.encode payload, [secret].pack("H*"), "HS256", header
end
- def update_ghost_post(uuid)
+ def update_ghost_post_via_api(uuid)
api_key = ENV["API_KEY"]
api_url = ENV["API_URL"]
return nil unless uuid.present? && api_key.present? && api_url.present?
@@ -1489,10 +1489,10 @@
post = JSON.parse(response.body.to_s)
url = post.to_h.dig("url")
doi = validate_doi(post.to_h.dig("id"))
doi = doi_as_url(doi)
-
+
return nil unless url.present? && doi.present?
# get id and updated_at from ghost api
slug = url.chomp("/").split("/").last
ghost_url = "#{api_url}/ghost/api/admin/posts/slug/#{slug}/"