fix: don't update onboarding status if user is not system manager

This commit is contained in:
Jannat Patel
2025-04-10 15:37:59 +05:30
parent 8e405bc8eb
commit 1a5d8ce07e
17 changed files with 115 additions and 55 deletions

View File

@@ -32,7 +32,7 @@
</template>
<script setup>
import { Dialog, createResource } from 'frappe-ui'
import { ref } from 'vue'
import { ref, inject } from 'vue'
import Link from '@/components/Controls/Link.vue'
import { showToast } from '@/utils'
import { useOnboarding } from 'frappe-ui/frappe'
@@ -41,6 +41,7 @@ import { useSettings } from '@/stores/settings'
const show = defineModel()
const course = ref(null)
const evaluator = ref(null)
const user = inject('$user')
const courses = defineModel('courses')
const { updateOnboardingStep } = useOnboarding('learning')
const settingsStore = useSettings()
@@ -73,9 +74,11 @@ const addCourse = (close) => {
{},
{
onSuccess() {
courses.value.reload()
updateOnboardingStep('add_batch_course')
if (user.data?.is_system_manager)
updateOnboardingStep('add_batch_course')
close()
courses.value.reload()
course.value = null
evaluator.value = null
},