api requests

This commit is contained in:
Tatiana Nikolaeva 2025-05-22 20:23:09 +05:00
parent fe74490440
commit 5a1cc7c43c
22 changed files with 665 additions and 133 deletions

View file

@ -38,16 +38,6 @@ const createRequestConfig = (method: string, isFormData: boolean = false): Reque
* @param response Ответ от fetch
* @returns Распарсенные данные или ошибку
*/
// const handleResponse = async (response: Response) => {
// const data = await response.json();
//
// if (!response.ok) {
// throw new Error(data.message || "Произошла ошибка");
// }
//
// return data;
// };
const handleResponse = async (response: Response) => {
// Проверяем, есть ли контент в ответе
const responseText = await response.text();