From 71951eabea7de3b40a5ddf3c574af353f1e96192 Mon Sep 17 00:00:00 2001 From: kirrg001 Date: Mon, 25 Feb 2019 23:51:23 +0100 Subject: [PATCH] Fixed webhook resource name for page events no issue - posts & pages live in the same table, need to use the event name --- core/server/services/webhooks/serialize.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/server/services/webhooks/serialize.js b/core/server/services/webhooks/serialize.js index 85f0521a85..73b0dad4b2 100644 --- a/core/server/services/webhooks/serialize.js +++ b/core/server/services/webhooks/serialize.js @@ -4,7 +4,9 @@ module.exports = (event, model) => { const api = require('../../api'); const apiVersion = model.get('api_version') || 'v2'; - const docName = model.tableName; + + const resourceName = event.match(/(\w+)\./)[1]; + const docName = `${resourceName}s`; const ops = [];