feat: Implement initial frontend for instructor and admin course management functionalities.
All checks were successful
Build and Deploy Frontend Management to Dev Server / Build Frontend Management Docker Image (push) Successful in 4m21s
Build and Deploy Frontend Management to Dev Server / Deploy E-learning Frontend Management to Dev Server (push) Successful in 7s
Build and Deploy Frontend Management to Dev Server / Notify Deployment Status (push) Successful in 1s
All checks were successful
Build and Deploy Frontend Management to Dev Server / Build Frontend Management Docker Image (push) Successful in 4m21s
Build and Deploy Frontend Management to Dev Server / Deploy E-learning Frontend Management to Dev Server (push) Successful in 7s
Build and Deploy Frontend Management to Dev Server / Notify Deployment Status (push) Successful in 1s
This commit is contained in:
parent
c8ef372d4e
commit
03f16cf2fd
15 changed files with 197 additions and 36 deletions
|
|
@ -342,11 +342,18 @@ const save = async () => {
|
|||
|
||||
saving.value = true;
|
||||
try {
|
||||
// Convert local datetime to ISO string to preserve timezone
|
||||
const payload = { ...form.value };
|
||||
if (payload.published_at) {
|
||||
const localDate = new Date(payload.published_at.replace(' ', 'T'));
|
||||
payload.published_at = localDate.toISOString();
|
||||
}
|
||||
|
||||
if (editing.value) {
|
||||
await instructorService.updateAnnouncement(props.courseId, editing.value.id, form.value);
|
||||
await instructorService.updateAnnouncement(props.courseId, editing.value.id, payload);
|
||||
$q.notify({ type: 'positive', message: 'บันทึกประกาศสำเร็จ', position: 'top' });
|
||||
} else {
|
||||
const created = await instructorService.createAnnouncement(props.courseId, form.value);
|
||||
const created = await instructorService.createAnnouncement(props.courseId, payload);
|
||||
|
||||
// Upload pending files
|
||||
for (const file of pendingFiles.value) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
<q-item-label caption>{{ instructor.user.email }}</q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section side v-if="isPrimaryInstructor">
|
||||
<q-item-section side v-if="isPrimaryInstructor && instructor.user_id !== currentUserId">
|
||||
<q-btn flat dense round icon="more_vert">
|
||||
<q-menu>
|
||||
<q-item v-if="!instructor.is_primary" clickable v-close-popup @click="setPrimary(instructor.user_id)">
|
||||
|
|
@ -139,6 +139,10 @@ const isPrimaryInstructor = computed(() => {
|
|||
return myRecord?.is_primary === true;
|
||||
});
|
||||
|
||||
const currentUserId = computed(() => {
|
||||
return authStore.user?.id ? parseInt(authStore.user.id) : null;
|
||||
});
|
||||
|
||||
// Methods
|
||||
const fetchInstructors = async () => {
|
||||
loading.value = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue