Patch to API Tools Website
Some code was out of order, fixed now.
This commit is contained in:
		
							parent
							
								
									d30d43b2ee
								
							
						
					
					
						commit
						dc06bc35df
					
				| 
						 | 
					@ -122,10 +122,6 @@ function sendPayload() {
 | 
				
			||||||
	var method;
 | 
						var method;
 | 
				
			||||||
	var path = "/api/";
 | 
						var path = "/api/";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (endpoint !== "generate") {
 | 
					 | 
				
			||||||
		xhr.setRequestHeader("X-Api-Key", apiField.value);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	switch (endpoint) {
 | 
						switch (endpoint) {
 | 
				
			||||||
		case "generate":
 | 
							case "generate":
 | 
				
			||||||
			method = "GET";
 | 
								method = "GET";
 | 
				
			||||||
| 
						 | 
					@ -152,6 +148,11 @@ function sendPayload() {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	xhr.open(method, path);
 | 
						xhr.open(method, path);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (endpoint !== "generate") {
 | 
				
			||||||
 | 
							xhr.setRequestHeader("X-Api-Key", apiField.value);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	xhr.send();
 | 
						xhr.send();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	xhr.onload = function() {
 | 
						xhr.onload = function() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue