mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-25 00:03:27 +08:00
21 lines
430 B
Ruby
21 lines
430 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Activities
|
|
class ActivityWebhookService
|
|
def initialize(webhook, activity)
|
|
@webhook = webhook
|
|
@activity = activity
|
|
end
|
|
|
|
def send_webhook
|
|
WebhookService.new(@webhook, activity_payload).send_webhook
|
|
end
|
|
|
|
def activity_payload
|
|
@activity.values.merge(
|
|
type: @activity.type_of,
|
|
created_at: @activity.created_at
|
|
)
|
|
end
|
|
end
|
|
end
|