/
SOFG1
/
hasida
Обзор
Документация
Войти
/
SOFG1
/
hasida
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/api/dashboard.ts
44 строки
895 B
Eddy
initial commit
22 июл 2024, 17:14
22 июл 2024, 17:14
b43c0d0
Код
Авторство
О чём код?
import { createApi } from "@reduxjs/toolkit/dist/query/react"; import { baseQuery } from "."; import { IProfile } from "./home"; export const dashboardApi = createApi({ reducerPath: "dashboardApi", baseQuery, tagTypes: ['Dashboard'], endpoints: (builder) => { return { getDashboard: builder.query<IDashboard, number>({ providesTags: ['Dashboard'], query: (days) => { return { url: "user/dashboard/", params: { days }, }; }, }), }; }, }); export const { useGetDashboardQuery } = dashboardApi; export interface IDashboard { activity: { i_liked: number; i_saw: number; searches: number; }; liked_me: IProfile[]; viewers: IProfile[]; i_liked: IProfile[]; likes_matches: IProfile[]; i_viewer: IProfile[]; show_in_search: { all: 0; open: 0; write: 0; }; }