promise wrangling

This commit is contained in:
2022-05-30 15:26:25 -05:00
parent 52bc6ec4ee
commit 2002fcdb45
5 changed files with 41 additions and 7 deletions

View File

@@ -7,6 +7,13 @@ export const getAllUsers = async () => {
return serverCall;
}
export const getOneUser = async (email: string) => {
let serverCall = await fetch(`http://localhost:8088/users?email=${email}`)
.then(res => res.json());
return serverCall;
}
export const registerNewUser = async (user: userInfo) => {
let serverCall = await fetch('http://localhost:8088/register', {
method: "POST",