From 2d124eb0ebed2d4139890038d3e1705c031fc2c3 Mon Sep 17 00:00:00 2001 From: Kavehhn174 Date: Fri, 21 Aug 2026 23:43:55 +0330 Subject: [PATCH] fix(dashboard): fix class edit page hang and move session notify action to class edit page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The class edit page hung/looped because ClassSessionsSection.vue still referenced a removed todayJalali() helper in the template, which threw a render error on every reactive update. Switch both usages to the getTodayJalali() composable function. Also remove the duplicate "اطلاع‌رسانی برگزاری جلسه" notify button/dialog from SessionListView.vue since the same action already exists per-session inside the class edit page. --- .../classes/ClassSessionsSection.vue | 4 +- src/views/sessions/SessionListView.vue | 71 ------------------- 2 files changed, 2 insertions(+), 73 deletions(-) diff --git a/src/components/classes/ClassSessionsSection.vue b/src/components/classes/ClassSessionsSection.vue index a386504..e0a9031 100644 --- a/src/components/classes/ClassSessionsSection.vue +++ b/src/components/classes/ClassSessionsSection.vue @@ -232,7 +232,7 @@
#{{ toPersianDigits(index + 1) }}
- +
@@ -261,7 +261,7 @@ label="افزودن ردیف" icon="pi pi-plus" text - @click="manualSessions.push({ date: todayJalali(), startTime: '19:00', endTime: '20:30', topic: '' })" + @click="manualSessions.push({ date: getTodayJalali(), startTime: '19:00', endTime: '20:30', topic: '' })" />
diff --git a/src/views/sessions/SessionListView.vue b/src/views/sessions/SessionListView.vue index 079efcf..d421f74 100644 --- a/src/views/sessions/SessionListView.vue +++ b/src/views/sessions/SessionListView.vue @@ -131,19 +131,6 @@ /> - -
@@ -211,7 +170,6 @@ import Column from 'primevue/column'; import Tag from 'primevue/tag'; import Select from 'primevue/select'; import Dropdown from 'primevue/select'; -import Dialog from 'primevue/dialog'; const { formatJalali, toPersianDigits } = usePersianDate(); const { showSuccess, showError } = useToast(); @@ -242,35 +200,6 @@ const selectedSession = ref(null); const bulkDeleteMode = ref(false); const isDeleting = ref(false); -const notifyDialogVisible = ref(false); -const selectedSessionForNotify = ref(null); -const notifyingSessionId = ref(null); -const isNotifying = ref(false); - -const openNotifyHoldingDialog = (session) => { - selectedSessionForNotify.value = session; - notifyDialogVisible.value = true; -}; - -const handleSendSessionHolding = async () => { - if (!selectedSessionForNotify.value) return; - const id = selectedSessionForNotify.value._id || selectedSessionForNotify.value.id; - notifyingSessionId.value = id; - isNotifying.value = true; - try { - const res = await sessionApi.notifyHolding(id); - const count = res.data?.sentCount || res.data?.totalStudents || ''; - showSuccess(`پیامک برگزاری جلسه با موفقیت به ${count ? toPersianDigits(count) + ' نفر از ' : ''}دانشجویان ارسال شد`); - notifyDialogVisible.value = false; - selectedSessionForNotify.value = null; - } catch (err) { - showError(err); - } finally { - notifyingSessionId.value = null; - isNotifying.value = false; - } -}; - const statusOptions = [ { label: 'طبق برنامه', value: 'scheduled' }, { label: 'برگزار شده', value: 'held' },