- Fix ELAI video generation (correct render endpoint, script splitting for 60s limit) - Fix speaking script generation error handling and empty response display - Add custom exam list API (GET /api/exam/custom/list) - Add assignments REST API (list, create, get) - Add rubrics REST API (list, create) - Enhance Generation page: dynamic exam structures, auto-module selection, preview dialog, audio player - Improve submit feedback with exam ID and status in toast notifications - Fix ExamsListPage to show both custom exams and exam sessions - Connect RubricsPage to backend API with fallback data - Add Dockerfile, docker-compose.yml, requirements.txt for deployment - Fix placement, grading, scoring, and auth controllers - Add ErrorBoundary component for frontend resilience - Add QA report and credentials documentation Made-with: Cursor
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
import { api } from "@/lib/api-client";
|
|
import type {
|
|
BulkCreateResult,
|
|
CSVValidationReport,
|
|
CredentialFilters,
|
|
CredentialStatus,
|
|
} from "@/types";
|
|
import type { ApiSuccessResponse } from "@/types";
|
|
|
|
export const entityOnboardingService = {
|
|
validateCsv: (file: File) => {
|
|
const fd = new FormData();
|
|
fd.append("file", file);
|
|
return api.upload<CSVValidationReport>("/entity/students/validate-csv", fd);
|
|
},
|
|
|
|
bulkCreate: (payload: { validate_session_id?: string }) =>
|
|
api.post<BulkCreateResult>("/entity/students/bulk-create", payload),
|
|
|
|
sendCredentials: (studentIds: number[]) =>
|
|
api.post<ApiSuccessResponse>("/entity/students/send-credentials", { user_ids: studentIds }),
|
|
|
|
getCredentialStatuses: (
|
|
filters?: CredentialFilters & { page?: number; limit?: number },
|
|
) =>
|
|
api.get<{ data: CredentialStatus[]; pagination?: { total: number; page: number } }>(
|
|
"/entity/students/credentials",
|
|
filters as Record<string, string | number | boolean | undefined>,
|
|
),
|
|
|
|
resendCredential: (studentId: number) =>
|
|
api.post<ApiSuccessResponse>(`/entity/students/${studentId}/resend-credentials`),
|
|
|
|
resendAllPending: () =>
|
|
api.post<ApiSuccessResponse>("/entity/students/resend-all-pending"),
|
|
};
|