const submitForm = async (data) => {
    const response = await fetch("https://talent-t.ru/form.php", {
        method: "POST",
        mode: "cors",
        headers: {
            "Content-Type": "application/json",
        },
        body: JSON.stringify(data)
    })
    .then((response) => {
        if (!response.ok) {
            throw new Error('Error!');
        }
        return response.status;
    })
    .catch(() => {
        return 500;
    })
    return response;
}

export default submitForm;