fix: circular dependency issues

This commit is contained in:
Jannat Patel
2026-02-11 19:24:50 +05:30
parent eab929da47
commit f59eecd34e
5 changed files with 1101 additions and 887 deletions

View File

@@ -51,12 +51,12 @@
"vuedraggable": "4.1.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "5.0.3",
"@vitejs/plugin-vue": "5.0.3",
"autoprefixer": "10.4.2",
"postcss": "8.4.5",
"tailwindcss": "^3.4.15",
"unplugin-auto-import": "^20.3.0",
"vite": "5.0.11",
"vite-plugin-pwa": "0.15.0"
"vite-plugin-pwa": "^1.2.0"
}
}

View File

@@ -1,7 +1,6 @@
import { defineStore } from 'pinia'
import { createResource } from 'frappe-ui'
import { usersStore } from './user'
import router from '@/router'
import { computed, reactive, ref } from 'vue'
export const sessionStore = defineStore('lms-session', () => {
@@ -22,19 +21,6 @@ export const sessionStore = defineStore('lms-session', () => {
let user = ref(sessionUser())
const isLoggedIn = computed(() => !!user.value)
const login = createResource({
url: 'login',
onError() {
throw new Error('Invalid email or password')
},
onSuccess() {
userResource.reload()
user.value = sessionUser()
login.reset()
router.replace({ path: '/' })
},
})
const logout = createResource({
url: 'logout',
onSuccess() {
@@ -59,7 +45,6 @@ export const sessionStore = defineStore('lms-session', () => {
return {
user,
isLoggedIn,
login,
logout,
brand,
branding,

View File

@@ -4,9 +4,10 @@ import AssessmentPlugin from '@/components/AssessmentPlugin.vue'
import translationPlugin from '../translation'
import { usersStore } from '@/stores/user'
import { call } from 'frappe-ui'
import router from '@/router'
import { useRouter } from 'vue-router'
import { getLmsRoute } from '@/utils/basePath'
const router = useRouter()
export class Assignment {
constructor({ data, api, readOnly }) {
this.data = data

View File

@@ -4,8 +4,10 @@ import { createApp, h } from 'vue'
import { usersStore } from '../stores/user'
import translationPlugin from '../translation'
import { CircleHelp } from 'lucide-vue-next'
import router from '@/router'
import { getLmsRoute } from '@/utils/basePath'
import { useRouter } from 'vue-router'
const router = useRouter()
export class Quiz {
constructor({ data, api, readOnly }) {

File diff suppressed because it is too large Load Diff