talos-access / frontend /src /services /sectionScheduleService.ts
Greg
Claude Opus 4.7 (1M context)
feat(schedule): spinner, filtered subjects, and teacher name in modal
fc9e304
Raw History Blame Contribute Delete
791 Bytes
import api from './api';
export interface SectionSchedule {
id: number;
section_id: number;
account_id: number;
day_of_week: number;
entry_time: string;
exit_time: string;
subject_id: number | null;
subject_name: string | null;
teacher_id?: number | null;
teacher_name?: string | null;
}
export async function listSectionSchedules(sectionId: number): Promise<SectionSchedule[]> {
const { data } = await api.get(`/sections/${sectionId}/schedules`);
return data;
}
export async function updateSectionSchedules(sectionId: number, schedules: { day_of_week: number; entry_time: string; exit_time: string; subject_id?: number | null }[]): Promise<SectionSchedule[]> {
const { data } = await api.put(`/sections/${sectionId}/schedules`, { schedules });
return data;
}