import fetchWrapper from "../fetchWrapper.js";
import getXSRFToken from "../getXSRF.js";
import Response from "../../interfaces/response.interface";

export default async function adminCreateUser(email: string, name: string, lastname: string, phone: string): Promise<Response> {
    const csrfToken = await getXSRFToken();

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