Skip to content

Instantly share code, notes, and snippets.

@mynameisthunder
Last active August 6, 2020 14:55
Show Gist options
  • Select an option

  • Save mynameisthunder/a41ac40029374b312217f71085a69af2 to your computer and use it in GitHub Desktop.

Select an option

Save mynameisthunder/a41ac40029374b312217f71085a69af2 to your computer and use it in GitHub Desktop.
hmta api newsletter error
// 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