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

@@ -33,7 +33,6 @@
"dayjs": "^1.11.6",
"dompurify": "^3.2.6",
"feather-icons": "^4.28.0",
"frappe-ui": "github:frappe/frappe-ui#6bcd7bf8af076b22a9b7beb8775d7273eb798ad0",
"highlight.js": "^11.11.1",
"lucide-vue-next": "^0.383.0",
"markdown-it": "^14.0.0",

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': {