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

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

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