diff --git a/core/server/api/canary/webhooks.js b/core/server/api/canary/webhooks.js index 50297a2592..327ed73576 100644 --- a/core/server/api/canary/webhooks.js +++ b/core/server/api/canary/webhooks.js @@ -15,23 +15,6 @@ module.exports = { data: [], permissions: true, async query(frame) { - const isIntegrationRequest = frame.options.context && frame.options.context.integration && frame.options.context.integration.id; - - // NOTE: this check can be removed once `webhooks.integration_id` gets foreigh ke constraint (Ghost 4.0) - if (!isIntegrationRequest && frame.data.webhooks[0].integration_id) { - const integration = await models.Integration.findOne({id: frame.data.webhooks[0].integration_id}, {context: {internal: true}}); - - if (!integration) { - throw new errors.ValidationError({ - message: i18n.t('notices.data.validation.index.schemaValidationFailed', { - key: 'integration_id' - }), - context: i18n.t('errors.api.webhooks.nonExistingIntegrationIdProvided.context'), - help: i18n.t('errors.api.webhooks.nonExistingIntegrationIdProvided.help') - }); - } - } - const webhook = await models.Webhook.getByEventAndTarget( frame.data.webhooks[0].event, frame.data.webhooks[0].target_url,