mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-30 17:37:26 +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.update', | ||||||
|   'entry.delete', |   'entry.delete', | ||||||
|   'media.create', |   'media.create', | ||||||
|  |   'media.update', | ||||||
|   'media.delete', |   'media.delete', | ||||||
| ]; | ]; | ||||||
| 
 | 
 | ||||||
| @ -165,11 +166,7 @@ module.exports = { | |||||||
| 
 | 
 | ||||||
|     const webhook = await strapi.webhookStore.findWebhook(id); |     const webhook = await strapi.webhookStore.findWebhook(id); | ||||||
| 
 | 
 | ||||||
|     const response = await strapi.webhookRunner.run( |     const response = await strapi.webhookRunner.run(webhook, 'trigger-test', {}); | ||||||
|       webhook, |  | ||||||
|       'trigger-test', |  | ||||||
|       {} |  | ||||||
|     ); |  | ||||||
| 
 | 
 | ||||||
|     ctx.body = { data: response }; |     ctx.body = { data: response }; | ||||||
|   }, |   }, | ||||||
|  | |||||||
| @ -13,7 +13,7 @@ const getMetadatas = buffer => | |||||||
| 
 | 
 | ||||||
| const getDimensions = buffer => | const getDimensions = buffer => | ||||||
|   getMetadatas(buffer) |   getMetadatas(buffer) | ||||||
|     .then(({ width, height }) => ({ width, height })) |     .then(({ width = null, height = null }) => ({ width, height })) | ||||||
|     .catch(() => ({})); // ignore errors
 |     .catch(() => ({})); // ignore errors
 | ||||||
| 
 | 
 | ||||||
| const THUMBNAIL_RESIZE_OPTIONS = { | const THUMBNAIL_RESIZE_OPTIONS = { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Alexandre Bodin
						Alexandre Bodin