Skip to content

Commit

Permalink
Merge pull request #827 from WGBH-MLA/fix-sonyci-webhook-endpoint
Browse files Browse the repository at this point in the history
Fixes Sony Ci Webhook endpoint
  • Loading branch information
orangewolf authored Feb 7, 2024
2 parents 64e7139 + 34e2fd2 commit f99bcb2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions app/controllers/sony_ci/webhooks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ class WebhooksController < ::APIController

def save_sony_ci_id
asset.admin_data.update!( sonyci_id: [ sony_ci_id ] )
# Re-save the Asset to re-index it.
# TODO: Is there a faster way to save the Sony Ci ID to the AdminData and
# re-index the Asset?
asset.save!
Hyrax.index_adapter.save(resource: asset)
render status: 200,
json: {
message: "success",
Expand All @@ -32,7 +29,7 @@ def save_sony_ci_id
private

def asset
@asset ||= Asset.find(guid_from_sony_ci_filename)
@asset ||= AssetResource.find(guid_from_sony_ci_filename)
end

# Returns the assumed GUID from the Sony Ci Filename.
Expand Down

0 comments on commit f99bcb2

Please sign in to comment.