import api from './api'; import type { TeacherSection } from '../types'; export async function listAssignments(): Promise { const { data } = await api.get('/teacher-sections'); return data; } export async function assignTeacher(payload: { section_id: number; teacher_id: number; subject_id: number }): Promise { const { data } = await api.post('/teacher-sections', payload); return data; } export async function removeTeacher(section_id: number, teacher_id: number): Promise { await api.delete(`/teacher-sections/${section_id}/${teacher_id}`); } /** Alias used by SectionsPage */ export const addTeacherToSection = assignTeacher;