Last active
August 6, 2020 14:55
-
-
Save mynameisthunder/a41ac40029374b312217f71085a69af2 to your computer and use it in GitHub Desktop.
hmta api newsletter error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // the end point im hitting is https://lyricgen.hmtaapi.com/api/v1/newslettercontacts/ | |
| // it returns the current list but doesnt update it. | |
| // if i try and update something even on the site( https://lyricgen.hmtaapi.com/api/v1/newslettercontacts/) such as | |
| // { first_name: 'luke', newsletter: 1,} it returns a server error | |
| async saveAndCloseOutNewletter() { | |
| const { firstName, lastName, email } = this.state; | |
| const body = { | |
| first_name: firstName, | |
| last_name: lastName, | |
| email_address: email, | |
| newsletter, | |
| }; | |
| try { | |
| const res = await axios.post( | |
| newsletterApi, | |
| body, | |
| ); | |
| console.log(res); | |
| } catch (e) { | |
| console.log(e, 'error'); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment