Changes
This commit is contained in:
@@ -13,7 +13,7 @@ const links = [{
|
||||
shortcuts.value = true
|
||||
}
|
||||
}, {
|
||||
label: 'Homepage',
|
||||
label: 'Webseite',
|
||||
icon: 'i-heroicons-book-open',
|
||||
to: 'https://fedeo.de',
|
||||
target: '_blank'
|
||||
|
||||
@@ -63,11 +63,11 @@ const historyItems = computed(() => {
|
||||
})
|
||||
const addHistoryItemData = ref({
|
||||
text: "",
|
||||
user: ""
|
||||
})
|
||||
|
||||
const addHistoryItem = async () => {
|
||||
addHistoryItemData.value.user = user.value.id
|
||||
console.log(addHistoryItemData.value)
|
||||
addHistoryItemData.value.createdBy = dataStore.activeProfile.id
|
||||
|
||||
if(type === "customer") {
|
||||
addHistoryItemData.value.customer = elementId
|
||||
@@ -197,7 +197,7 @@ const renderText = (text) => {
|
||||
/>
|
||||
<div>
|
||||
<h3 v-if="item.createdBy">{{dataStore.getProfileById(item.createdBy) ? dataStore.getProfileById(item.createdBy).fullName : ""}}</h3>
|
||||
<h3 v-else>Spaces Bot</h3>
|
||||
<h3 v-else>FEDEO Bot</h3>
|
||||
<span v-html="renderText(item.text)"/><br>
|
||||
<span class="text-gray-500">{{dayjs(item.created_at).format("DD.MM.YY HH:mm")}}</span>
|
||||
</div>
|
||||
|
||||
@@ -12,34 +12,7 @@ const items = computed(() => [
|
||||
slot: 'account',
|
||||
label: '',
|
||||
disabled: true
|
||||
}], [{
|
||||
label: 'Suche',
|
||||
icon: 'i-heroicons-command-line',
|
||||
shortcuts: [metaSymbol.value, 'K'],
|
||||
click: () => {
|
||||
isDashboardSearchModalOpen.value = true
|
||||
}
|
||||
}, {
|
||||
label: 'Hilfe & Support',
|
||||
icon: 'i-heroicons-question-mark-circle',
|
||||
shortcuts: ['?'],
|
||||
click: () => isHelpSlideoverOpen.value = true
|
||||
}], [{
|
||||
label: 'Webseite',
|
||||
icon: 'i-heroicons-book-open',
|
||||
to: 'https://fedeo.de',
|
||||
target: '_blank'
|
||||
},/* {
|
||||
label: 'GitHub repository',
|
||||
icon: 'i-simple-icons-github',
|
||||
to: 'https://github.com/nuxt/ui-pro',
|
||||
target: '_blank'
|
||||
}, {
|
||||
label: 'Buy Nuxt UI Pro',
|
||||
icon: 'i-heroicons-credit-card',
|
||||
to: 'https://ui.nuxt.com/pro/purchase',
|
||||
target: '_blank'
|
||||
}*/], [{
|
||||
}], [{
|
||||
label: 'Abmelden',
|
||||
icon: 'i-heroicons-arrow-left-on-rectangle',
|
||||
click: async () => {
|
||||
|
||||
@@ -270,7 +270,7 @@ let links = computed(() => {
|
||||
defaultOpen: false,
|
||||
children: [
|
||||
{
|
||||
label: "Steuerung",
|
||||
label: "Vorgänge",
|
||||
to: "/inventory",
|
||||
icon: "i-heroicons-square-3-stack-3d"
|
||||
},
|
||||
@@ -456,7 +456,16 @@ const footerLinks = [/*{
|
||||
<UDashboardSearchButton label="Suche..."/>
|
||||
</template>
|
||||
|
||||
<UDashboardSidebarLinks :links="links" />
|
||||
<UDashboardSidebarLinks :links="links" >
|
||||
|
||||
</UDashboardSidebarLinks>
|
||||
|
||||
<!-- <UAccordion
|
||||
:items="links"
|
||||
>
|
||||
|
||||
</UAccordion>-->
|
||||
|
||||
|
||||
<div class="flex-1" />
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ setupPage()
|
||||
|
||||
<UTabs
|
||||
v-if="currentItem && mode == 'show'"
|
||||
:items="[{label: 'Informationen'}, /*{label: 'Logbuch'},*/ {label: 'Projekte'},{label: 'Objekte'},{label: 'Verträge'}, {label: 'Ansprechpartner'}]"
|
||||
:items="[{label: 'Informationen'},{label: 'Projekte'},{label: 'Objekte'},{label: 'Verträge'}]"
|
||||
class="p-5"
|
||||
>
|
||||
<template #item="{item}">
|
||||
@@ -223,7 +223,7 @@ setupPage()
|
||||
<UButton
|
||||
@click="router.push(`/contracts/create?customer=${currentItem.id}`)"
|
||||
>
|
||||
+ Objekt
|
||||
+ Vertrag
|
||||
</UButton>
|
||||
</Toolbar>
|
||||
<UTable
|
||||
|
||||
@@ -206,7 +206,7 @@ setupPage()
|
||||
></USelectMenu>
|
||||
<UButton
|
||||
@click="itemInfo.resources.push(dataStore.getResourcesList.find(i => i.id === resourceToAdd))"
|
||||
:disabled="itemInfo.resources.find(i => i.id === resourceToAdd)"
|
||||
:disabled="itemInfo.resources.find(i => i.id === resourceToAdd)"
|
||||
>
|
||||
+ Hinzufügen
|
||||
</UButton>
|
||||
|
||||
@@ -134,7 +134,7 @@ function changeFocusToQuantity() {
|
||||
<USelectMenu
|
||||
:options="dataStore.spaces"
|
||||
searchable
|
||||
option-attribute="description"
|
||||
option-attribute="spaceNumber"
|
||||
:color="checkSpaceId(inventoryChangeData.spaceId) ? 'primary' : 'rose'"
|
||||
v-model="inventoryChangeData.spaceId"
|
||||
v-on:select="changeFocusToQuantity"
|
||||
|
||||
@@ -9,6 +9,7 @@ const user = useSupabaseUser()
|
||||
const router = useRouter()
|
||||
const colorMode = useColorMode()
|
||||
const dataStore = useDataStore()
|
||||
const toast = useToast()
|
||||
|
||||
const isLight = computed({
|
||||
get () {
|
||||
@@ -43,9 +44,12 @@ const onSubmit = async (data) => {
|
||||
password: data.password
|
||||
})
|
||||
if(error) {
|
||||
console.log(error.toString())
|
||||
if(error.toString().toLowerCase().includes("invalid")){
|
||||
toast.add({title:"Zugangsdaten falsch",color:"rose"})
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log("Login Successful")
|
||||
//console.log("Login Successful")
|
||||
dataStore.initializeData(user.id)
|
||||
router.push("/")
|
||||
|
||||
|
||||
@@ -13,7 +13,9 @@ let currentItem = ref(null)
|
||||
|
||||
//Working
|
||||
const mode = ref(route.params.mode || "show")
|
||||
const itemInfo = ref({})
|
||||
const itemInfo = ref({
|
||||
profile: dataStore.activeProfile.id
|
||||
})
|
||||
const oldItemInfo = ref({})
|
||||
const categories = ["Offen", "In Bearbeitung", "Dringed", "Erledigt"]
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ const setupPage = () => {
|
||||
}
|
||||
|
||||
if(mode.value === "edit") itemInfo.value = currentItem.value
|
||||
if(currentItem.value.id) oldItemInfo.value = JSON.parse(JSON.stringify(currentItem.value))
|
||||
if(currentItem.value) oldItemInfo.value = JSON.parse(JSON.stringify(currentItem.value))
|
||||
}
|
||||
|
||||
const cancelEditorCreate = () => {
|
||||
|
||||
@@ -55,6 +55,7 @@ setupPage()
|
||||
</UButton>
|
||||
<UButton
|
||||
v-else-if="mode === 'edit' && !itemInfo.id"
|
||||
@click="dataStore.createNewItem('workingtimes',itemInfo)"
|
||||
>
|
||||
Erstellen
|
||||
</UButton>
|
||||
|
||||
398
stores/data.js
398
stores/data.js
@@ -490,218 +490,218 @@ export const useDataStore = defineStore('data', () => {
|
||||
//console.log(oldData)
|
||||
//console.log(newData)
|
||||
|
||||
let itemsToCreate = []
|
||||
if(dataTypes[dataType].historyItemHolder){
|
||||
let itemsToCreate = []
|
||||
|
||||
const checkPropState = (key,propContent) => {
|
||||
//console.log(propContent)
|
||||
if(propContent.type && propContent.data){
|
||||
if(propContent.type === "updated" ||propContent.type === "created"){
|
||||
createHistoryItem(key,propContent)
|
||||
const checkPropState = (key,propContent) => {
|
||||
//console.log(propContent)
|
||||
if(propContent.type && propContent.data){
|
||||
if(propContent.type === "updated" ||propContent.type === "created"){
|
||||
createHistoryItem(key,propContent)
|
||||
}
|
||||
} else {
|
||||
for (let prop in propContent) {
|
||||
checkPropState(prop,propContent[prop])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const createHistoryItem = (key,prop) => {
|
||||
|
||||
//console.log("OLD: " + prop.data.o)
|
||||
//console.log("NEW: " + prop.data.n)
|
||||
|
||||
let name = "" || key
|
||||
let oldVal = prop.data.o || "-"
|
||||
let newVal = prop.data.n || "-"
|
||||
|
||||
|
||||
|
||||
if(key === "project") {
|
||||
name = "Projekt"
|
||||
oldVal = oldVal !== "-" ? projects.value.find(i => i.id === prop.data.o).name : "-"
|
||||
newVal = projects.value.find(i => i.id === prop.data.n).name
|
||||
} else if (key === "title") {
|
||||
name = "Titel"
|
||||
} else if(key === "type") {
|
||||
name = "Typ"
|
||||
} else if(key === "notes") {
|
||||
name = "Notizen"
|
||||
} else if(key === "link") {
|
||||
name = "Link"
|
||||
} else if(key === "start") {
|
||||
name = "Start"
|
||||
oldVal = dayjs(prop.data.o).format("DD.MM.YYYY HH:mm")
|
||||
newVal = dayjs(prop.data.n).format("DD.MM.YYYY HH:mm")
|
||||
} else if(key === "end") {
|
||||
name = "Ende"
|
||||
oldVal = dayjs(prop.data.o).format("DD.MM.YYYY HH:mm")
|
||||
newVal = dayjs(prop.data.n).format("DD.MM.YYYY HH:mm")
|
||||
} else if(key === "birthday") {
|
||||
name = "Geburtstag"
|
||||
oldVal = dayjs(prop.data.o).format("DD.MM.YYY")
|
||||
newVal = dayjs(prop.data.n).format("DD.MM.YYY")
|
||||
} else if(key === "resources") {
|
||||
name = "Resourcen"
|
||||
oldVal = prop.data.o.map(i => i.title).join(", ")
|
||||
newVal = prop.data.n.map(i => i.title).join(", ")
|
||||
} else if(key === "customerNumber") {
|
||||
name = "Kundennummer"
|
||||
} else if(key === "active") {
|
||||
name = "Aktiv"
|
||||
if(oldVal === true){
|
||||
oldVal = "Aktiv"
|
||||
newVal = "Gesperrt"
|
||||
} else if(oldVal === "-") {
|
||||
oldVal = "Gesperrt"
|
||||
newVal = "Aktiv"
|
||||
}
|
||||
} else if(key === "isCompany") {
|
||||
name = "Firmenkunde"
|
||||
if(oldVal === true){
|
||||
oldVal = "Firma"
|
||||
newVal = "Privatkunde"
|
||||
} else if(oldVal === "-") {
|
||||
oldVal = "Privatkunde"
|
||||
newVal = "Firma"
|
||||
}
|
||||
} else if(key === "special") {
|
||||
name = "Adresszusatz"
|
||||
} else if(key === "street") {
|
||||
name = "Straße & Hausnummer"
|
||||
} else if(key === "city") {
|
||||
name = "Ort"
|
||||
} else if(key === "zip") {
|
||||
name = "Postleitzahl"
|
||||
} else if(key === "country") {
|
||||
name = "Land"
|
||||
} else if(key === "web") {
|
||||
name = "Webseite"
|
||||
} else if(key === "email") {
|
||||
name = "E-Mail"
|
||||
} else if(key === "tel") {
|
||||
name = "Telefon"
|
||||
} else if(key === "ustid") {
|
||||
name = "USt-ID"
|
||||
} else if(key === "role") {
|
||||
name = "Rolle"
|
||||
} else if(key === "phoneHome") {
|
||||
name = "Festnetz"
|
||||
} else if(key === "phoneMobile") {
|
||||
name = "Mobiltelefon"
|
||||
} else if(key === "salutation") {
|
||||
name = "Anrede"
|
||||
} else if(key === "firstName") {
|
||||
name = "Vorname"
|
||||
} else if(key === "lastName") {
|
||||
name = "Nachname"
|
||||
} else if(key === "name") {
|
||||
name = "Name"
|
||||
} else if(key === "customer") {
|
||||
name = "Kunde"
|
||||
oldVal = customers.value.find(i => i.id === prop.data.o).name
|
||||
newVal = customers.value.find(i => i.id === prop.data.n).name
|
||||
} else if(key === "vendor") {
|
||||
name = "Lieferant"
|
||||
oldVal = vendors.value.find(i => i.id === prop.data.o).name
|
||||
newVal = vendors.value.find(i => i.id === prop.data.n).name
|
||||
} else if(key === "description") {
|
||||
name = "Beschreibung"
|
||||
} else if(key === "categorie") {
|
||||
name = "Kategorie"
|
||||
} else if(key === "profile") {
|
||||
name = "Mitarbeiter"
|
||||
oldVal = profiles.value.find(i => i.id === prop.data.o).fullName
|
||||
newVal = profiles.value.find(i => i.id === prop.data.n).fullName
|
||||
} else if(key === "plant") {
|
||||
name = "Objekt"
|
||||
oldVal = plants.value.find(i => i.id === prop.data.o).name
|
||||
newVal = plants.value.find(i => i.id === prop.data.n).name
|
||||
} else if(key === "annualPaidLeaveDays") {
|
||||
name = "Urlaubstage"
|
||||
} else if(key === "employeeNumber") {
|
||||
name = "Mitarbeiternummer"
|
||||
} else if(key === "weeklyWorkingDays") {
|
||||
name = "Wöchentliche Arbeitstage"
|
||||
} else if(key === "weeklyWorkingHours") {
|
||||
name = "Wöchentliche Arbeitszeit"
|
||||
} else if(key === "licensePlate") {
|
||||
name = "Kennzeichen"
|
||||
} else if(key === "driver") {
|
||||
name = "Fahrer"
|
||||
oldVal = profiles.value.find(i => i.id === prop.data.o).fullName
|
||||
newVal = profiles.value.find(i => i.id === prop.data.n).fullName
|
||||
}
|
||||
|
||||
|
||||
|
||||
let text = ""
|
||||
if(prop.type === "updated" && newVal !== "-" && oldVal !== "-") {
|
||||
text = `Gerändert: ${name} von "${oldVal}" zu "${newVal}"`
|
||||
} else if(prop.type === "updated" && newVal !== "-" && oldVal === "-") {
|
||||
text = `Hinzugefügt: ${name} "${newVal}"`
|
||||
} else if(prop.type === "created") {
|
||||
text = `Hinzugefügt: ${name} "${newVal}"`
|
||||
} else if(prop.type === "updated" && newVal === "-" && oldVal !== "-") {
|
||||
text = `Entfernt: ${name} "${oldVal}"`
|
||||
}
|
||||
|
||||
let historyItem = {
|
||||
text: text,
|
||||
createdBy: activeProfile.value.id,
|
||||
oldVal: prop.data.o,
|
||||
newVal: prop.data.n,
|
||||
tenant: currentTenant.value
|
||||
}
|
||||
|
||||
historyItem[dataTypes[dataType].historyItemHolder] = newData.id
|
||||
|
||||
|
||||
const checkIfNaN = (x) => {
|
||||
return typeof x === "number" && x !== x;
|
||||
}
|
||||
//console.log(key)
|
||||
//console.log(checkIfNaN(key))
|
||||
|
||||
if(key !== "fullName" && key !== "phases") {
|
||||
//console.log(historyItem)
|
||||
itemsToCreate.push(historyItem)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(oldData) {
|
||||
let result = deepDiffMapper.map(oldData,newData)
|
||||
|
||||
//console.log(result)
|
||||
|
||||
for (let prop in result) {
|
||||
//console.log(prop)
|
||||
checkPropState(prop,result[prop])
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
for (let prop in propContent) {
|
||||
checkPropState(prop,propContent[prop])
|
||||
let historyItem = {
|
||||
text: `${dataTypes[dataType].labelSingle} erstellt`,
|
||||
createdBy: activeProfile.value.id,
|
||||
tenant: currentTenant.value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const createHistoryItem = (key,prop) => {
|
||||
historyItem[dataTypes[dataType].historyItemHolder] = newData.id
|
||||
|
||||
//console.log("OLD: " + prop.data.o)
|
||||
//console.log("NEW: " + prop.data.n)
|
||||
|
||||
let name = "" || key
|
||||
let oldVal = prop.data.o || "-"
|
||||
let newVal = prop.data.n || "-"
|
||||
|
||||
|
||||
|
||||
if(key === "project") {
|
||||
name = "Projekt"
|
||||
oldVal = projects.value.find(i => i.id === prop.data.o).name
|
||||
newVal = projects.value.find(i => i.id === prop.data.n).name
|
||||
} else if (key === "title") {
|
||||
name = "Titel"
|
||||
} else if(key === "type") {
|
||||
name = "Typ"
|
||||
} else if(key === "notes") {
|
||||
name = "Notizen"
|
||||
} else if(key === "link") {
|
||||
name = "Link"
|
||||
} else if(key === "start") {
|
||||
name = "Start"
|
||||
oldVal = dayjs(prop.data.o).format("DD.MM.YYYY HH:mm")
|
||||
newVal = dayjs(prop.data.n).format("DD.MM.YYYY HH:mm")
|
||||
} else if(key === "end") {
|
||||
name = "Ende"
|
||||
oldVal = dayjs(prop.data.o).format("DD.MM.YYYY HH:mm")
|
||||
newVal = dayjs(prop.data.n).format("DD.MM.YYYY HH:mm")
|
||||
} else if(key === "birthday") {
|
||||
name = "Geburtstag"
|
||||
oldVal = dayjs(prop.data.o).format("DD.MM.YYY")
|
||||
newVal = dayjs(prop.data.n).format("DD.MM.YYY")
|
||||
} else if(key === "resources") {
|
||||
name = "Resourcen"
|
||||
oldVal = prop.data.o.map(i => i.title).join(", ")
|
||||
newVal = prop.data.n.map(i => i.title).join(", ")
|
||||
} else if(key === "customerNumber") {
|
||||
name = "Kundennummer"
|
||||
} else if(key === "active") {
|
||||
name = "Aktiv"
|
||||
if(oldVal === true){
|
||||
oldVal = "Aktiv"
|
||||
newVal = "Gesperrt"
|
||||
} else if(oldVal === "-") {
|
||||
oldVal = "Gesperrt"
|
||||
newVal = "Aktiv"
|
||||
}
|
||||
} else if(key === "isCompany") {
|
||||
name = "Firmenkunde"
|
||||
if(oldVal === true){
|
||||
oldVal = "Firma"
|
||||
newVal = "Privatkunde"
|
||||
} else if(oldVal === "-") {
|
||||
oldVal = "Privatkunde"
|
||||
newVal = "Firma"
|
||||
}
|
||||
} else if(key === "special") {
|
||||
name = "Adresszusatz"
|
||||
} else if(key === "street") {
|
||||
name = "Straße & Hausnummer"
|
||||
} else if(key === "city") {
|
||||
name = "Ort"
|
||||
} else if(key === "zip") {
|
||||
name = "Postleitzahl"
|
||||
} else if(key === "country") {
|
||||
name = "Land"
|
||||
} else if(key === "web") {
|
||||
name = "Webseite"
|
||||
} else if(key === "email") {
|
||||
name = "E-Mail"
|
||||
} else if(key === "tel") {
|
||||
name = "Telefon"
|
||||
} else if(key === "ustid") {
|
||||
name = "USt-ID"
|
||||
} else if(key === "role") {
|
||||
name = "Rolle"
|
||||
} else if(key === "phoneHome") {
|
||||
name = "Festnetz"
|
||||
} else if(key === "phoneMobile") {
|
||||
name = "Mobiltelefon"
|
||||
} else if(key === "salutation") {
|
||||
name = "Anrede"
|
||||
} else if(key === "firstName") {
|
||||
name = "Vorname"
|
||||
} else if(key === "lastName") {
|
||||
name = "Nachname"
|
||||
} else if(key === "name") {
|
||||
name = "Name"
|
||||
} else if(key === "customer") {
|
||||
name = "Kunde"
|
||||
oldVal = customers.value.find(i => i.id === prop.data.o).name
|
||||
newVal = customers.value.find(i => i.id === prop.data.n).name
|
||||
} else if(key === "vendor") {
|
||||
name = "Lieferant"
|
||||
oldVal = vendors.value.find(i => i.id === prop.data.o).name
|
||||
newVal = vendors.value.find(i => i.id === prop.data.n).name
|
||||
} else if(key === "description") {
|
||||
name = "Beschreibung"
|
||||
} else if(key === "categorie") {
|
||||
name = "Kategorie"
|
||||
} else if(key === "profile") {
|
||||
name = "Mitarbeiter"
|
||||
oldVal = profiles.value.find(i => i.id === prop.data.o).fullName
|
||||
newVal = profiles.value.find(i => i.id === prop.data.n).fullName
|
||||
} else if(key === "plant") {
|
||||
name = "Objekt"
|
||||
oldVal = plants.value.find(i => i.id === prop.data.o).name
|
||||
newVal = plants.value.find(i => i.id === prop.data.n).name
|
||||
} else if(key === "annualPaidLeaveDays") {
|
||||
name = "Urlaubstage"
|
||||
} else if(key === "employeeNumber") {
|
||||
name = "Mitarbeiternummer"
|
||||
} else if(key === "weeklyWorkingDays") {
|
||||
name = "Wöchentliche Arbeitstage"
|
||||
} else if(key === "weeklyWorkingHours") {
|
||||
name = "Wöchentliche Arbeitszeit"
|
||||
} else if(key === "licensePlate") {
|
||||
name = "Kennzeichen"
|
||||
} else if(key === "driver") {
|
||||
name = "Fahrer"
|
||||
oldVal = profiles.value.find(i => i.id === prop.data.o).fullName
|
||||
newVal = profiles.value.find(i => i.id === prop.data.n).fullName
|
||||
}
|
||||
|
||||
|
||||
|
||||
let text = ""
|
||||
if(prop.type === "updated" && newVal !== "-" && oldVal !== "-") {
|
||||
text = `Gerändert: ${name} von "${oldVal}" zu "${newVal}"`
|
||||
} else if(prop.type === "updated" && newVal !== "-" && oldVal === "-") {
|
||||
text = `Hinzugefügt: ${name} "${newVal}"`
|
||||
} else if(prop.type === "created") {
|
||||
text = `Hinzugefügt: ${name} "${newVal}"`
|
||||
} else if(prop.type === "updated" && newVal === "-" && oldVal !== "-") {
|
||||
text = `Entfernt: ${name} "${oldVal}"`
|
||||
}
|
||||
|
||||
let historyItem = {
|
||||
text: text,
|
||||
createdBy: activeProfile.value.id,
|
||||
oldVal: prop.data.o,
|
||||
newVal: prop.data.n,
|
||||
tenant: currentTenant.value
|
||||
}
|
||||
|
||||
historyItem[dataTypes[dataType].historyItemHolder] = newData.id
|
||||
|
||||
|
||||
const checkIfNaN = (x) => {
|
||||
return typeof x === "number" && x !== x;
|
||||
}
|
||||
//console.log(key)
|
||||
//console.log(checkIfNaN(key))
|
||||
|
||||
if(key !== "fullName" && key !== "phases") {
|
||||
//console.log(historyItem)
|
||||
itemsToCreate.push(historyItem)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(oldData) {
|
||||
let result = deepDiffMapper.map(oldData,newData)
|
||||
|
||||
//console.log(result)
|
||||
|
||||
for (let prop in result) {
|
||||
//console.log(prop)
|
||||
checkPropState(prop,result[prop])
|
||||
const {data,error} = await supabase.from("historyitems").insert(itemsToCreate)
|
||||
|
||||
if(error) {
|
||||
console.log(error)
|
||||
} else {
|
||||
fetchHistoryItems()
|
||||
}
|
||||
|
||||
} else {
|
||||
let historyItem = {
|
||||
text: `${dataTypes[dataType].labelSingle} erstellt`,
|
||||
createdBy: activeProfile.value.id,
|
||||
tenant: currentTenant.value
|
||||
}
|
||||
|
||||
historyItem[dataTypes[dataType].historyItemHolder] = newData.id
|
||||
|
||||
//console.log(historyItem)
|
||||
itemsToCreate.push(historyItem)
|
||||
}
|
||||
|
||||
const {data,error} = await supabase.from("historyitems").insert(itemsToCreate)
|
||||
|
||||
if(error) {
|
||||
console.log(error)
|
||||
} else {
|
||||
fetchHistoryItems()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user