refactor main and rendered ipc

This commit is contained in:
riqo 2021-05-22 15:02:49 -05:00 committed by Enrique Hernandez
commit ddb2f4df0f
28 changed files with 758 additions and 211 deletions

36
src/api/account.ts Normal file
View file

@ -0,0 +1,36 @@
import { useHttp } from "@/modules/http";
import axios from "axios";
const { post } = useHttp();
export const submit =
async (email: string, password: string) => (
await post('/account/login', {
email,
password
})
)
export const logout =
async (): Promise<null | Error> => (await post('/account/logout'));
export const fetchProfile = async(email: string, token: string) => (
await axios({
url: "http://127.0.0.1:3000/api/account/profile",
headers: {
Cookie: `jwt=${token}`
},
method: 'GET',
data: {
email,
}
})
)