fix: misc batch issues

This commit is contained in:
Jannat Patel
2025-05-13 11:46:00 +05:30
parent e6945ac076
commit 403e56b4ef
15 changed files with 110 additions and 672 deletions

View File

@@ -270,6 +270,7 @@ import {
FormControl,
FileUploader,
usePageMeta,
toast,
} from 'frappe-ui'
import {
inject,
@@ -282,7 +283,7 @@ import {
getCurrentInstance,
} from 'vue'
import { showToast } from '@/utils'
import { Image, Trash2, X } from 'lucide-vue-next'
import { Check, Image, Trash2, X } from 'lucide-vue-next'
import { useRouter } from 'vue-router'
import { capture } from '@/telemetry'
import { useOnboarding } from 'frappe-ui/frappe'
@@ -449,7 +450,28 @@ const submitCourse = () => {
},
{
onSuccess() {
showToast('Success', 'Course updated successfully', 'check')
console.log('Course updated successfully')
/* showToast('Success', 'Course updated successfully', 'check') */
/* First arg of toast.promise is a promiseToResolve and second is the options obj, how to write this */
toast.promise(
new Promise((resolve) => {
resolve()
}),
{
open: true,
type: 'success',
message: __('Course updated successfully'),
icon: Check,
duration: 500,
}
)
/* toast.promise({
open: true,
type: 'success',
message: __('Course updated successfully'),
icon: Check,
duration: 5
}) */
},
onError(err) {
showToast('Error', err.messages?.[0] || err, 'x')