feat: Implement course instructor management UI with search, add, set primary, and remove instructor capabilities.
This commit is contained in:
parent
7ad15778e6
commit
5b1af9d43b
5 changed files with 27 additions and 6 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue