Skip to content

Instantly share code, notes, and snippets.

@polluterofminds
Last active January 13, 2021 15:42
Show Gist options
  • Save polluterofminds/13a517970c7aeb53fffa8d5abf44aeb3 to your computer and use it in GitHub Desktop.
Save polluterofminds/13a517970c7aeb53fffa8d5abf44aeb3 to your computer and use it in GitHub Desktop.
Auth
import axios from "axios";
export const subscribe = async (email) => {
try {
const data = {
email
}
await axios.post("/api/subscribe", data);
return true;
} catch (error) {
console.log(error.response);
throw error;
}
}
export const login = async (email) => {
try {
const data = {
email
}
await axios.post("/api/login", data);
return true;
} catch (error) {
console.log(error.response);
throw error;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment