fix: announcements should to go one student at a time

This commit is contained in:
Jannat Patel
2025-02-12 12:46:57 +05:30
parent 1c3e84e9bb
commit ee73790127
3 changed files with 22 additions and 13 deletions

View File

@@ -33,9 +33,9 @@
{{ __('Announcement') }}
</div>
<TextEditor
:bubbleMenu="true"
:fixedMenu="true"
@change="(val) => (announcement.announcement = val)"
editorClass="prose-sm py-2 px-2 min-h-[200px] border-outline-gray-2 hover:border-outline-gray-3 rounded-md bg-surface-gray-3"
editorClass="prose-sm py-2 px-2 min-h-[200px] border-outline-gray-2 hover:border-outline-gray-3 rounded-b-md bg-surface-gray-3"
/>
</div>
</div>
@@ -67,16 +67,13 @@ const announcement = reactive({
})
const announcementResource = createResource({
url: 'frappe.core.doctype.communication.email.make',
url: 'lms.lms.api.make_announcement',
makeParams(values) {
return {
recipients: props.students.join(', '),
students: props.students,
cc: announcement.replyTo,
subject: announcement.subject,
content: announcement.announcement,
doctype: 'LMS Batch',
name: props.batch,
send_email: 1,
}
},
})
@@ -102,7 +99,7 @@ const makeAnnouncement = (close) => {
)
},
onError(err) {
showToast(__('Error'), __(err.messages?.[0] || err), 'check')
showToast(__('Error'), __(err.messages?.[0] || err), 'alert-circle')
},
}
)