Allow to create the media.update webhook + fix default width and height

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
Alexandre Bodin 2020-04-15 19:15:21 +02:00
parent 3a0219033f
commit 7123f68737
2 changed files with 3 additions and 6 deletions

View File

@ -8,6 +8,7 @@ const ALLOWED_EVENTS = [
'entry.update',
'entry.delete',
'media.create',
'media.update',
'media.delete',
];
@ -165,11 +166,7 @@ module.exports = {
const webhook = await strapi.webhookStore.findWebhook(id);
const response = await strapi.webhookRunner.run(
webhook,
'trigger-test',
{}
);
const response = await strapi.webhookRunner.run(webhook, 'trigger-test', {});
ctx.body = { data: response };
},

View File

@ -13,7 +13,7 @@ const getMetadatas = buffer =>
const getDimensions = buffer =>
getMetadatas(buffer)
.then(({ width, height }) => ({ width, height }))
.then(({ width = null, height = null }) => ({ width, height }))
.catch(() => ({})); // ignore errors
const THUMBNAIL_RESIZE_OPTIONS = {