fixing how the health-form prod and dev system works
This commit is contained in:
		
							parent
							
								
									58309d95e7
								
							
						
					
					
						commit
						23a7930a98
					
				
					 1 changed files with 12 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -66,6 +66,7 @@
 | 
			
		|||
     let obj = {};
 | 
			
		||||
     data.forEach((value, key) => obj[key] = value);
 | 
			
		||||
 | 
			
		||||
     // For use in dev
 | 
			
		||||
     fetch("http://localhost:4242/health-form", {
 | 
			
		||||
         method: "POST",
 | 
			
		||||
         body: data
 | 
			
		||||
| 
						 | 
				
			
			@ -83,13 +84,23 @@
 | 
			
		|||
         }
 | 
			
		||||
     });
 | 
			
		||||
 | 
			
		||||
     // For use in prod
 | 
			
		||||
     /* var xhr = new XMLHttpRequest();
 | 
			
		||||
      * xhr.onreadystatechange = function() {
 | 
			
		||||
      *     if (this.readyState == 4 && this.status == 200) {
 | 
			
		||||
      *         if (mtRegistration === 'now')
 | 
			
		||||
      *             window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13DM3';
 | 
			
		||||
      *         else if (registration === 'now')
 | 
			
		||||
      *             window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13JPJ';
 | 
			
		||||
      *         else if (registration === 'full')
 | 
			
		||||
      *             window.location.href = 'https://secure.myvanco.com/L-Z772/campaign/C-13JQE';
 | 
			
		||||
      *         else
 | 
			
		||||
      *             window.location.href = '/thankyou/';
 | 
			
		||||
      *     }
 | 
			
		||||
      * };
 | 
			
		||||
      * xhr.open("POST", "https://n8n.tfcconnection.org/webhook/health-form");
 | 
			
		||||
      * xhr.send(data); */
 | 
			
		||||
 | 
			
		||||
     console.log(data);
 | 
			
		||||
     /* window.location.replace("https://tfcconnection.org/thankyou/"); */
 | 
			
		||||
 }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue