/
gr.ev.vl
/
TestGen
Обзор
Документация
Войти
/
gr.ev.vl
/
TestGen
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
backend/frontend/src/api/misconceptions.ts
51 строка
1 KB
gr.ev.vl
4
07 июн 2026, 12:17
07 июн 2026, 12:17
18d328a
Код
Авторство
О чём код?
import apiClient from "./client"; export interface Misconception { id: string; subtopic_id: string; misconception_text: string; reason_explanation: string; source: string; status: string; created_at: string | null; } export interface MisconceptionListResponse { items: Misconception[]; total: number; } export async function listMisconceptions(params: { subtopic_id?: string; status?: string; limit?: number; offset?: number; }): Promise<MisconceptionListResponse> { const response = await apiClient.get<MisconceptionListResponse>("/misconceptions", { params }); return response.data; } /** * Принять заблуждения (список ID). */ export async function acceptMisconceptions(data: { ids: string[] }): Promise<void> { await apiClient.post("/misconceptions/accept", data); } /** * Отклонить заблуждения (список ID). */ export async function rejectMisconceptions(data: { ids: string[] }): Promise<void> { await apiClient.post("/misconceptions/reject", data); } /** * Обновить заблуждение. */ export async function updateMisconception( misconceptionId: string, data: { misconception_text?: string; reason_explanation?: string } ): Promise<Misconception> { const response = await apiClient.put<Misconception>(`/misconceptions/${misconceptionId}`, data); return response.data; }