Fixed webhook resource name for page events

no issue

- posts & pages live in the same table, need to use the event name
This commit is contained in:
kirrg001 2019-02-25 23:51:23 +01:00
parent 6c50dadb90
commit 71951eabea

View File

@ -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 = [];