Spaces:
Runtime error
Runtime error
Greg
Claude Opus 4.7 (1M context)
feat(ta-01): show sex breakdown (M/F) in admin attendance counter
4aadf35 Download frontend/src/services/adminAttendanceService.ts from Talosware/talos-access: direct link, hf CLI and curl.
- Browser
- Download file 1.63 kB
-
https://huggingface.co/spaces/Talosware/talos-access/resolve/main/frontend/src/services/adminAttendanceService.ts
- Command line
-
hf download hf://spaces/Talosware/talos-access/frontend/src/services/adminAttendanceService.ts
-
curl -L -o adminAttendanceService.ts https://huggingface.co/spaces/Talosware/talos-access/resolve/main/frontend/src/services/adminAttendanceService.ts
1.63 kB
| import api from './api'; | |
| export interface AdminSection { id: number; name: string } | |
| export interface AdminRosterItem { | |
| id: number; | |
| name: string; | |
| lastname: string; | |
| card_id: string | null; | |
| phone_number: string | null; | |
| sex: 'M' | 'F' | null; | |
| already_checked_in: boolean; | |
| entrance_logged: boolean; | |
| } | |
| export interface AdminAttendanceRecord { student_id: number; present: boolean } | |
| export interface AdminSwipeResponse { created: number; total: number; skipped: number[] } | |
| export const adminAttendanceService = { | |
| async listSections(): Promise<AdminSection[]> { | |
| const { data } = await api.get<AdminSection[]>('/admin/sections'); | |
| return data; | |
| }, | |
| async getRoster(sectionId: number, date?: string): Promise<AdminRosterItem[]> { | |
| const { data } = await api.get<AdminRosterItem[]>( | |
| `/admin/sections/${sectionId}/roster`, | |
| { params: date ? { date } : {} }, | |
| ); | |
| return data; | |
| }, | |
| async swipe( | |
| sectionId: number, | |
| records: AdminAttendanceRecord[], | |
| subjectId?: number, | |
| ): Promise<AdminSwipeResponse> { | |
| const { data } = await api.post<AdminSwipeResponse>( | |
| '/admin/attendance/swipe', | |
| { section_id: sectionId, subject_id: subjectId, records }, | |
| ); | |
| return data; | |
| }, | |
| async batchToggle( | |
| sectionId: number, | |
| records: AdminAttendanceRecord[], | |
| date?: string, | |
| subjectId?: number, | |
| ): Promise<AdminSwipeResponse> { | |
| const { data } = await api.post<AdminSwipeResponse>( | |
| '/admin/attendance/batch-toggle', | |
| { section_id: sectionId, subject_id: subjectId, records }, | |
| { params: date ? { date } : {} }, | |
| ); | |
| return data; | |
| }, | |
| }; | |