feat(schedule): add academic system sync and course management improvements
- add educational system synchronization with username/password authentication - implement long-press course deletion with single/all options - add multi-lane course display for overlapping same-name courses - refactor course detail screen with ScrollView and improved layout - fix teacher display to show per-time-slot instructors instead of single field - add settings modal with sync option and loading states
This commit is contained in:
@@ -32,6 +32,19 @@ interface CreateScheduleCourseResponse {
|
||||
course: ScheduleCourseDTO;
|
||||
}
|
||||
|
||||
interface SyncScheduleRequest {
|
||||
username: string;
|
||||
password: string;
|
||||
semester?: string;
|
||||
}
|
||||
|
||||
interface SyncScheduleResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
synced_count: number;
|
||||
error_message?: string;
|
||||
}
|
||||
|
||||
const toCourse = (dto: ScheduleCourseDTO): Course => ({
|
||||
id: dto.id,
|
||||
name: dto.name,
|
||||
@@ -64,7 +77,12 @@ class ScheduleService {
|
||||
async deleteCourse(courseId: string): Promise<void> {
|
||||
await api.delete(`/schedule/courses/${courseId}`);
|
||||
}
|
||||
|
||||
async syncSchedule(req: SyncScheduleRequest): Promise<SyncScheduleResponse> {
|
||||
const response = await api.post<SyncScheduleResponse>('/schedule/sync', req);
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
export const scheduleService = new ScheduleService();
|
||||
export type { CreateScheduleCourseRequest };
|
||||
export type { CreateScheduleCourseRequest, SyncScheduleRequest };
|
||||
|
||||
Reference in New Issue
Block a user