Last active
November 21, 2021 16:58
-
-
Save YajanaRao/b0e06da42a938322c53f708e93ecd3a1 to your computer and use it in GitHub Desktop.
Includes functions related to api call
This file contains 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
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