mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-31 02:57:57 +00:00 
			
		
		
		
	 026e03c307
			
		
	
	026e03c307
	
	
	
		
			
			When the CC field is generated in the UI, the email values are joined together with ", " but when they are parsed, we currently split by just ",". This causes an error on the backend and on the frontend. It seems reasonable to update the code to allow whitespace in the input and to split by `\s*,\s` and also to trim leading and trailing whitespace from the CC list. --------- Co-authored-by: Sojan <sojan@pepalo.com>
		
			
				
	
	
		
			8 lines
		
	
	
		
			254 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			8 lines
		
	
	
		
			254 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import emailValidator from 'vuelidate/lib/validators/email';
 | |
| 
 | |
| export const validEmailsByComma = value => {
 | |
|   if (!value.length) return true;
 | |
|   const emails = value.replace(/\s+/g, '').split(',');
 | |
|   return emails.every(email => emailValidator(email));
 | |
| };
 |