Skip to content

Instantly share code, notes, and snippets.

@YajanaRao
Last active November 21, 2021 16:58
Show Gist options
  • Save YajanaRao/b0e06da42a938322c53f708e93ecd3a1 to your computer and use it in GitHub Desktop.
Save YajanaRao/b0e06da42a938322c53f708e93ecd3a1 to your computer and use it in GitHub Desktop.
Includes functions related to api call
const baseUrl = "https://alpha.yajananrao.io";
export function register({ email, username, password, confirmPassword }) {
const data = {
username,
email,
"password1": password,
"password2": confirmPassword
};
return fetch(`${baseUrl}/auth/registration/`, {
method: "POST",
body: JSON.stringify(data)
})
}
export function login({ email, username, password }) {
return fetch(`${baseUrl}/auth/login/`, {
method: "POST",
body: JSON.stringify({ email, username, password })
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment