fix: redirect to courses if user is not moderator on data import

This commit is contained in:
Jannat Patel
2025-11-27 12:41:39 +05:30
parent cfc5d94711
commit eae74dacae
3 changed files with 13 additions and 3 deletions

View File

@@ -9,10 +9,21 @@
import { usePageMeta } from 'frappe-ui'
import { DataImport } from 'frappe-ui/frappe'
import { sessionStore } from '../stores/session'
import { useRoute } from 'vue-router'
import { useRoute, useRouter } from 'vue-router'
import { inject, onMounted } from 'vue'
const { brand } = sessionStore()
const route = useRoute()
const router = useRouter()
const user = inject<any>('$user')
onMounted(() => {
if (!user.data?.is_moderator) {
router.push({
name: 'Courses',
})
}
})
const doctypeMap = {
'LMS Course': {