feat: Implement course instructor management UI with search, add, set primary, and remove instructor capabilities.

This commit is contained in:
Missez 2026-02-05 16:39:58 +07:00
parent 7ad15778e6
commit 5b1af9d43b
5 changed files with 27 additions and 6 deletions

View file

@ -175,7 +175,7 @@ const addInstructor = async () => {
if (!selectedUser.value) return;
addingInstructor.value = true;
try {
await instructorService.addCourseInstructor(props.courseId, selectedUser.value.id);
await instructorService.addInstructor(props.courseId, selectedUser.value.email);
$q.notify({ type: 'positive', message: 'เพิ่มผู้สอนสำเร็จ', position: 'top' });
showAddDialog.value = false;
selectedUser.value = null;
@ -213,7 +213,7 @@ const removeInstructor = async (userId: number) => {
persistent: true
}).onOk(async () => {
try {
await instructorService.removeCourseInstructor(props.courseId, userId);
await instructorService.removeInstructor(props.courseId, userId);
$q.notify({ type: 'positive', message: 'ลบผู้สอนสำเร็จ', position: 'top' });
fetchInstructors();
} catch (error: any) {