import axiosInstance from "./_axiosInstance"; import { AuthLoginResponse, Pagination, QuestionResponse, UserResponse } from "./types"; export const get_questions = async (page: number, test_id?: number, question_id?: number) => { const response = await axiosInstance.get>("/api/questions/", { params: { page, test_id, question_id } }) return response.data; } export const get_question = async (id: number) => { const response = await axiosInstance.get<{ data: QuestionResponse }>(`/api/questions/${id}`); return response.data; } export const get_current_user = async () => { const response = await axiosInstance.get<{ user: UserResponse }>("/api/auth/me/"); return response.data; } export const post_login = async (email: string, password: string) => { const response = await axiosInstance.post("/api/auth/login/", { email, password }); return response.data; }