check vocabulary
This commit is contained in:
@@ -94,6 +94,39 @@ export interface Word {
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface VocabularyPassSummaryItem {
|
||||
userId: string;
|
||||
username: string;
|
||||
fullname: string;
|
||||
email?: string;
|
||||
passedWords: number;
|
||||
uniqueWords: number;
|
||||
testRecords: number;
|
||||
wordSets: number;
|
||||
testTypes: string[];
|
||||
firstPassedAt: string;
|
||||
lastPassedAt: string;
|
||||
}
|
||||
|
||||
export interface VocabularyPassSummaryResponse {
|
||||
start: string;
|
||||
end: string;
|
||||
totalStudents: number;
|
||||
totalPassedWords: number;
|
||||
items: VocabularyPassSummaryItem[];
|
||||
}
|
||||
|
||||
export interface ClearVocabularyPassSummaryResponse {
|
||||
message: string;
|
||||
userId?: string;
|
||||
username?: string;
|
||||
fullname?: string;
|
||||
deletedRecords: number;
|
||||
removedPassedWords: number;
|
||||
affectedWords: number;
|
||||
rebuiltWords: number;
|
||||
}
|
||||
|
||||
export const adminApi = {
|
||||
getUsers: async (): Promise<User[]> => {
|
||||
return api.get<User[]>('/admin/users');
|
||||
@@ -176,5 +209,12 @@ export const adminApi = {
|
||||
updateWords: async (words: any[]) => {
|
||||
return api.put('/api/vocabulary/words', { words });
|
||||
},
|
||||
};
|
||||
|
||||
getVocabularyPassSummary: async (params: { start: string; end: string }): Promise<VocabularyPassSummaryResponse> => {
|
||||
return api.get<VocabularyPassSummaryResponse>('/admin/vocabulary/test-pass-summary', { params });
|
||||
},
|
||||
|
||||
clearVocabularyPassSummary: async (data: { userId: string; start: string; end: string }): Promise<ClearVocabularyPassSummaryResponse> => {
|
||||
return api.post<ClearVocabularyPassSummaryResponse>('/admin/vocabulary/test-pass-summary/clear', data);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user