/
SOFG1
/
generic
Обзор
Документация
Войти
/
SOFG1
/
generic
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/api/opponents.ts
49 строк
1 KB
Eddy
initial commit
22 июл 2024, 17:06
22 июл 2024, 17:06
a72fa2b
Код
Авторство
О чём код?
import { primaryInstance } from "."; export const Opponents = { getOpponents: async (token: string, keyword: string, country_id?: number) => { return await primaryInstance.get(`sm_stats/opponnents/`, { params: { keyword, country_id: country_id ? country_id : null }, headers: { Authorization: `Token ${token}`, }, }); }, getOpponentData: async ( token: string, opponentPageIds: string, days: number, countryId?: number ) => { return await primaryInstance.post( `sm_stats/opponnents/`, { opponnent: opponentPageIds, days, country_id: countryId ? countryId : null, }, { headers: { Authorization: `Token ${token}`, }, } ); }, getOpponentsGTrends: async ( token: string, keywords: string, days: number, countryFilter?: number ) => { return await primaryInstance.get(`sm_stats/gtrends/`, { params: { keywords, days, country_id: countryFilter ? countryFilter : null, }, headers: { Authorization: `Token ${token}`, }, }); }, };