api requests
This commit is contained in:
parent
fe74490440
commit
5a1cc7c43c
22 changed files with 665 additions and 133 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue