This commit is contained in:
2024-02-22 19:01:12 +01:00
parent 4e3ac183d4
commit c6e0854544
8 changed files with 493 additions and 24 deletions

View File

@@ -92,7 +92,12 @@ export const useDataStore = defineStore('data', () => {
label: "Inventarartikel",
labelSingle: "Inventarartikel",
redirect: true
}
},
services: {
label: "Leistungen",
labelSingle: "Leistung",
redirect: true
},
}
const documentTypesForCreation = ref({
@@ -165,6 +170,7 @@ export const useDataStore = defineStore('data', () => {
const emailAccounts = ref([])
const texttemplates =ref([])
const services =ref([])
const serviceCategories =ref([])
const rights = ref({
@@ -281,6 +287,7 @@ export const useDataStore = defineStore('data', () => {
await fetchEmailAccounts()
await fetchTextTemplates()
await fetchServices()
await fetchServiceCategories()
loaded.value = true
}
@@ -324,6 +331,7 @@ export const useDataStore = defineStore('data', () => {
emailAccounts.value = []
texttemplates.value = []
services.value = []
serviceCategories.value = []
}
function hasRight (right) {
@@ -607,6 +615,10 @@ export const useDataStore = defineStore('data', () => {
services.value = (await supabase.from("services").select().eq('tenant', currentTenant.value)).data
}
async function fetchServiceCategories() {
serviceCategories.value = (await supabase.from("serviceCategories").select().eq('tenant', currentTenant.value)).data
}
async function fetchDocuments () {
let tempDocuments = (await supabase.from("documents").select().eq('tenant', currentTenant.value)).data
@@ -1053,6 +1065,7 @@ export const useDataStore = defineStore('data', () => {
emailAccounts,
texttemplates,
services,
serviceCategories,
documentTypesForCreation,
//Functions