import fetchWrapper from "./fetchWrapper";
import getXSRFToken from "./getXSRF";

export default async function register(email:string, password:string, name:string, lastname:string, phone:string) {
    const csrfToken = await getXSRFToken();

    return fetchWrapper(
        "/api/users/register",
        { email, password, name, lastname, phone },
        "POST",
        { "X-XSRF-TOKEN": csrfToken }
    );
}
