Not sure why I'm getting a 400 error? Just for context I'm using vue-form-wizard within a vue.js web app, the following code is in a method i can onComplete of the multi-step form.
submitToGoogleSheet() { const scriptURL = "https://script.google.com/a/talkaboutdepression.org/macros/s/...../exec"; const formData = new FormData(); formData.append("timestamp", new Date()); formData.append("age", this.age); formData.append("gender", this.gender); formData.append("marital", this.marital); formData.append("ethnicity", this.ethnicity); formData.append("totalScore", this.totalScore); formData.append("geolocation", this.location); fetch(scriptURL, { method: "POST", mode: "no-cors", body: formData, headers: { "content-type": "multipart/form-data", }, }) .then((response) => console.log(response)) .catch((error) => console.error(error.message)); },
UPDATE 4/14/2020 I realized I had to go back and re run the function "Now, go to Run > Run Function > initialSetup to run this function."
Thank you! hope anyone else who runs into this tries this first
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Not sure why I'm getting a 400 error? Just for context I'm using vue-form-wizard within a vue.js web app, the following code is in a method i can onComplete of the multi-step form.
UPDATE 4/14/2020 I realized I had to go back and re run the function
"Now, go to Run > Run Function > initialSetup to run this function."
Thank you! hope anyone else who runs into this tries this first