zwischenstand
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { api } from "../../../api"
|
||||
import { navigation, serviceNavigation } from "../../store"
|
||||
export async function loadNavigationAndSetStores(): Promise<null> {
|
||||
const navigations = await api<Navigation[]>("navigation", {})
|
||||
let navigationStore: NavElement[] = []
|
||||
let serviceNavigationStore: NavElement[] = []
|
||||
navigations.data.forEach((nav: Navigation) => {
|
||||
if (nav.tree == 0) navigationStore = nav.elements
|
||||
else if (nav.tree == 1) serviceNavigationStore = nav.elements
|
||||
})
|
||||
navigation.set(navigationStore)
|
||||
serviceNavigation.set(serviceNavigationStore)
|
||||
|
||||
return null
|
||||
}
|
||||
Reference in New Issue
Block a user