/
WorldOfYuri
/
react-1
Обзор
Документация
Войти
/
WorldOfYuri
/
react-1
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/api/api.ts
27 строк
648 B
Юрий Кузмичев
add useSelector and useDispatch
21 июл 2023, 13:45
21 июл 2023, 13:45
d34690f
Код
Авторство
О чём код?
import axios from "axios"; import { UserType } from "../types/types"; export const instance = axios.create({ withCredentials: true, baseURL: "https://social-network.samuraijs.com/api/1.0/", headers: { "API-KEY": "ecde3c0d-59e4-455a-83a2-08df3f1d6c37", }, }); export enum ResultCodeEnum { Succes = 0, Error = 1, } export enum ResultCodeEnumForCaptcha { CaptchaIsRequired = 10, } export type GetItemsType = { items: Array<UserType>; totalCount: number; error: string | null; }; export type APIResponseType<D = {}, RC = ResultCodeEnum> = { data: D; messages: Array<string>; resultCode: RC; };