refactor: learning path

This commit is contained in:
Jannat Patel
2025-08-14 20:26:46 +05:30
parent 78ff2e6d07
commit 625ddac65a
21 changed files with 785 additions and 681 deletions

View File

@@ -8,13 +8,6 @@ export const useSettings = defineStore('settings', () => {
const isSettingsOpen = ref(false)
const activeTab = ref(null)
const learningPaths = createResource({
url: 'lms.lms.api.get_lms_setting',
params: { field: 'enable_learning_paths' },
auto: true,
cache: ['learningPath'],
})
const allowGuestAccess = createResource({
url: 'lms.lms.api.get_lms_setting',
params: { field: 'allow_guest_access' },
@@ -38,7 +31,6 @@ export const useSettings = defineStore('settings', () => {
return {
isSettingsOpen,
activeTab,
learningPaths,
allowGuestAccess,
preventSkippingVideos,
sidebarSettings,

View File

@@ -4,6 +4,7 @@ import { ref } from 'vue'
export const useSidebar = defineStore('sidebar', () => {
const isSidebarCollapsed = ref(false)
const isWebpagesCollapsed = ref(true)
const canAccessPrograms = ref(false)
if (localStorage.getItem('isSidebarCollapsed')) {
isSidebarCollapsed.value = JSON.parse(

View File

@@ -1,15 +1,12 @@
import { defineStore } from 'pinia'
import { createResource } from 'frappe-ui'
import { useRouter } from 'vue-router'
const router = useRouter()
export const usersStore = defineStore('lms-users', () => {
let userResource = createResource({
url: 'lms.lms.api.get_user_info',
onError(error) {
if (error && error.exc_type === 'AuthenticationError') {
router.push('/login')
window.location.href = '/login'
}
},
auto: true,