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

export default async function updateUser(name: string, lastname: string, phone: string | null) {
  const csrfToken = await getXSRFToken();
  return fetchWrapper(
    "/api/users/update",
    { name, lastname, phone },
    "POST",
    { "X-XSRF-TOKEN": csrfToken }
  );
}
