lib/pact_broker/api/resources/webhooks.rb in pact_broker-2.74.1 vs lib/pact_broker/api/resources/webhooks.rb in pact_broker-2.75.0
- old
+ new
@@ -41,15 +41,15 @@
true
end
def from_json
saved_webhook = webhook_service.create next_uuid, webhook, consumer, provider
- response.body = Decorators::WebhookDecorator.new(saved_webhook).to_json(decorator_options)
+ response.body = decorator_class(:webhook_decorator).new(saved_webhook).to_json(decorator_options)
end
def to_json
- Decorators::WebhooksDecorator.new(webhooks).to_json(decorator_options(resource_title: 'Pact webhooks'))
+ decorator_class(:webhooks_decorator).new(webhooks).to_json(decorator_options(resource_title: 'Pact webhooks'))
end
def policy_name
request.post? ? :'webhooks::webhook' : :'webhooks::webhooks'
end
@@ -59,10 +59,10 @@
def webhooks
webhook_service.find_by_consumer_and_provider(consumer, provider)
end
def webhook
- @webhook ||= Decorators::WebhookDecorator.new(PactBroker::Domain::Webhook.new).from_json(request_body)
+ @webhook ||= decorator_class(:webhook_decorator).new(PactBroker::Domain::Webhook.new).from_json(request_body)
end
def next_uuid
@next_uuid ||= webhook_service.next_uuid
end