mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 18:08:11 +00:00 
			
		
		
		
	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:
		
							parent
							
								
									3a0219033f
								
							
						
					
					
						commit
						7123f68737
					
				| @ -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 }; | ||||
|   }, | ||||
|  | ||||
| @ -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 = { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Alexandre Bodin
						Alexandre Bodin