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

@@ -106,7 +106,7 @@
</template>
<script setup>
import { Dialog, FormControl, TextEditor, createResource } from 'frappe-ui'
import { computed, watch, reactive, ref } from 'vue'
import { computed, watch, reactive, ref, inject } from 'vue'
import Link from '@/components/Controls/Link.vue'
import { showToast } from '@/utils'
import { useOnboarding } from 'frappe-ui/frappe'
@@ -115,6 +115,7 @@ const show = defineModel()
const quiz = defineModel('quiz')
const questionType = ref(null)
const editMode = ref(false)
const user = inject('$user')
const { updateOnboardingStep } = useOnboarding('learning')
const existingQuestion = reactive({
@@ -262,8 +263,10 @@ const addQuestionRow = (question, close) => {
},
{
onSuccess() {
if (user.data?.is_system_manager)
updateOnboardingStep('create_first_quiz')
show.value = false
updateOnboardingStep('create_first_quiz')
showToast(__('Success'), __('Question added successfully'), 'check')
quiz.value.reload()
close()