fix: circular dependency issues
This commit is contained in:
@@ -51,12 +51,12 @@
|
|||||||
"vuedraggable": "4.1.0"
|
"vuedraggable": "4.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vitejs/plugin-vue": "5.0.3",
|
"@vitejs/plugin-vue": "5.0.3",
|
||||||
"autoprefixer": "10.4.2",
|
"autoprefixer": "10.4.2",
|
||||||
"postcss": "8.4.5",
|
"postcss": "8.4.5",
|
||||||
"tailwindcss": "^3.4.15",
|
"tailwindcss": "^3.4.15",
|
||||||
"unplugin-auto-import": "^20.3.0",
|
"unplugin-auto-import": "^20.3.0",
|
||||||
"vite": "5.0.11",
|
"vite": "5.0.11",
|
||||||
"vite-plugin-pwa": "0.15.0"
|
"vite-plugin-pwa": "^1.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { createResource } from 'frappe-ui'
|
import { createResource } from 'frappe-ui'
|
||||||
import { usersStore } from './user'
|
import { usersStore } from './user'
|
||||||
import router from '@/router'
|
|
||||||
import { computed, reactive, ref } from 'vue'
|
import { computed, reactive, ref } from 'vue'
|
||||||
|
|
||||||
export const sessionStore = defineStore('lms-session', () => {
|
export const sessionStore = defineStore('lms-session', () => {
|
||||||
@@ -22,19 +21,6 @@ export const sessionStore = defineStore('lms-session', () => {
|
|||||||
let user = ref(sessionUser())
|
let user = ref(sessionUser())
|
||||||
const isLoggedIn = computed(() => !!user.value)
|
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({
|
const logout = createResource({
|
||||||
url: 'logout',
|
url: 'logout',
|
||||||
onSuccess() {
|
onSuccess() {
|
||||||
@@ -59,7 +45,6 @@ export const sessionStore = defineStore('lms-session', () => {
|
|||||||
return {
|
return {
|
||||||
user,
|
user,
|
||||||
isLoggedIn,
|
isLoggedIn,
|
||||||
login,
|
|
||||||
logout,
|
logout,
|
||||||
brand,
|
brand,
|
||||||
branding,
|
branding,
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ import AssessmentPlugin from '@/components/AssessmentPlugin.vue'
|
|||||||
import translationPlugin from '../translation'
|
import translationPlugin from '../translation'
|
||||||
import { usersStore } from '@/stores/user'
|
import { usersStore } from '@/stores/user'
|
||||||
import { call } from 'frappe-ui'
|
import { call } from 'frappe-ui'
|
||||||
import router from '@/router'
|
import { useRouter } from 'vue-router'
|
||||||
import { getLmsRoute } from '@/utils/basePath'
|
import { getLmsRoute } from '@/utils/basePath'
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
export class Assignment {
|
export class Assignment {
|
||||||
constructor({ data, api, readOnly }) {
|
constructor({ data, api, readOnly }) {
|
||||||
this.data = data
|
this.data = data
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ import { createApp, h } from 'vue'
|
|||||||
import { usersStore } from '../stores/user'
|
import { usersStore } from '../stores/user'
|
||||||
import translationPlugin from '../translation'
|
import translationPlugin from '../translation'
|
||||||
import { CircleHelp } from 'lucide-vue-next'
|
import { CircleHelp } from 'lucide-vue-next'
|
||||||
import router from '@/router'
|
|
||||||
import { getLmsRoute } from '@/utils/basePath'
|
import { getLmsRoute } from '@/utils/basePath'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
export class Quiz {
|
export class Quiz {
|
||||||
constructor({ data, api, readOnly }) {
|
constructor({ data, api, readOnly }) {
|
||||||
|
|||||||
1962
frontend/yarn.lock
1962
frontend/yarn.lock
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user