mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 09:56:44 +00:00 
			
		
		
		
	Enable to create/trigger webhooks with no events (#12174)
Co-authored-by: cyril lopez <cyril@strapi.io>
This commit is contained in:
		
							parent
							
								
									d8acb3df67
								
							
						
					
					
						commit
						ce09d38972
					
				| @ -63,7 +63,7 @@ const EventInput = ({ isDraftAndPublish }) => { | ||||
|     : displayedData.events.default; | ||||
| 
 | ||||
|   const { formatMessage } = useIntl(); | ||||
|   const { values, errors, handleChange: onChange } = useFormikContext(); | ||||
|   const { values, handleChange: onChange } = useFormikContext(); | ||||
| 
 | ||||
|   const inputName = 'events'; | ||||
|   const inputValue = values.events; | ||||
| @ -100,7 +100,7 @@ const EventInput = ({ isDraftAndPublish }) => { | ||||
| 
 | ||||
|   return ( | ||||
|     <Stack size={1}> | ||||
|       <FieldLabel required> | ||||
|       <FieldLabel> | ||||
|         {formatMessage({ | ||||
|           id: 'Settings.webhooks.form.events', | ||||
|           defaultMessage: 'Events', | ||||
| @ -154,14 +154,6 @@ const EventInput = ({ isDraftAndPublish }) => { | ||||
|           })} | ||||
|         </tbody> | ||||
|       </StyledTable> | ||||
|       {errors.events && ( | ||||
|         <Typography variant="pi" textColor="danger600" data-strapi-field-error> | ||||
|           {formatMessage({ | ||||
|             id: 'components.Input.error.validation.required', | ||||
|             defaultMessage: 'This value is required', | ||||
|           })} | ||||
|         </Typography> | ||||
|       )} | ||||
|     </Stack> | ||||
|   ); | ||||
| }; | ||||
|  | ||||
| @ -29,10 +29,7 @@ const schema = yup.object().shape({ | ||||
|       }) | ||||
|     ); | ||||
|   }), | ||||
|   events: yup | ||||
|     .array() | ||||
|     .min(1, translatedErrors.min) | ||||
|     .required(translatedErrors.required), | ||||
|   events: yup.array(), | ||||
| }); | ||||
| 
 | ||||
| export default schema; | ||||
|  | ||||
| @ -28,16 +28,12 @@ const webhookValidator = yup | ||||
|         ) | ||||
|         .required(); | ||||
|     }), | ||||
|     events: yup | ||||
|       .array() | ||||
|       .of( | ||||
|     events: yup.array().of( | ||||
|       yup | ||||
|         .string() | ||||
|         .oneOf(_.values(webhookUtils.webhookEvents)) | ||||
|         .required() | ||||
|       ) | ||||
|       .min(1) | ||||
|       .required(), | ||||
|     ), | ||||
|   }) | ||||
|   .noUnknown(); | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jean-Sébastien Herbaux
						Jean-Sébastien Herbaux