EscolaLMS/sdk

View on GitHub
src/services/student/exams.ts

Summary

Maintainability
A
3 hrs
Test Coverage
import request, { RequestOptionsInit } from "umi-request";
import * as API from "../../types/api";

export async function exams(
  apiUrl: string,
  token: string,
  params?: API.ExamsParams,
  options?: RequestOptionsInit
) {
  return request<API.ExamsList>(`${apiUrl}/api/exams`, {
    method: "GET",
    params,
    headers: {
      Accept: "application/json",
      "Content-Type": "application/json",
      Authorization: `Bearer ${token}`,
    },
    ...(options || {}),
  });
}