Pass in work package to webhook

[ci skip]
pull/7878/head
Oliver Günther 5 years ago
parent 674a29c426
commit e3adc26678
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 3
      modules/webhooks/lib/open_project/webhooks/event_resources/work_package.rb

@ -22,8 +22,9 @@ module OpenProject::Webhooks::EventResources
def handle_notification(payload, event_name)
action = payload[:journal].initial? ? "created" : "updated"
event_name = prefixed_event_name(action)
work_package = payload[:journal].journable
active_webhooks.with_event_name(event_name).pluck(:id).each do |id|
WorkPackageWebhookJob.perform_later(id, payload[:journal].id, event_name)
WorkPackageWebhookJob.perform_later(id, work_package, event_name)
end
end
end

Loading…
Cancel
Save