Skip to content

Commit

Permalink
Merge pull request #332 from scientist-softserv/reindex-after-save
Browse files Browse the repository at this point in the history
🧹 Reindex the child work after save
  • Loading branch information
kirkkwang authored Feb 6, 2024
2 parents 2377759 + 58697d9 commit a2f04ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/listeners/iiif_print/listener.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def on_object_membership_updated(event)
return unless object.respond_to?(:iiif_print_config?) && object.iiif_print_config?

Hyrax.custom_queries.find_child_works(resource: object).each do |child_work|
unless child_work.is_child
child_work.is_child = true
Hyrax.persister.save(resource: child_work)
end
next if child_work.is_child
child_work.is_child = true
Hyrax.persister.save(resource: child_work)
Hyrax.index_adapter.save(resource: child_work)
end
end
end
Expand Down

0 comments on commit a2f04ab

Please sign in to comment.