Files
openfoodnetwork/engines/dfc_provider/app/services/proxy_notifier.rb
Maikel Linke 1973e36634 Extract token and HTTP layer for re-use
Calling a webhook as a platform and fetching enterprise data will have
the same auth.
2025-12-10 16:24:53 +11:00

16 lines
402 B
Ruby

# frozen_string_literal: true
# Call a webhook to notify a data proxy about changes in our data.
class ProxyNotifier
def refresh(platform, enterprise_url)
endpoint = ApiUser.webhook_url(platform)
data = {
eventType: "refresh",
enterpriseUrlid: enterprise_url,
scope: "ReadEnterprise",
}
api = DfcPlatformRequest.new(platform)
api.call(endpoint, data)
end
end