Some Changes

This commit is contained in:
2024-11-20 23:00:43 +01:00
parent 46ddd5659b
commit 3633b8ee37

View File

@@ -151,7 +151,16 @@ const projectHours = () => {
return hours.toFixed(2)
}
const updateProject = async () => {
let initialPhases = projecttypes.value.find(i => i.id === itemInfo.value.projecttype).initialPhases
if(oldItemInfo.value.phases.length === 0) {
itemInfo.value.phases = initialPhases
}
await dataStore.updateItem('projects',itemInfo.value,oldItemInfo.value)
}
const createProject = async () => {
let initialPhases = projecttypes.value.find(i => i.id === itemInfo.value.projecttype).initialPhases
@@ -245,7 +254,7 @@ const renderedPhases = computed(() => {
<template #right>
<UButton
v-if="mode === 'edit'"
@click="dataStore.updateItem('projects',itemInfo,oldItemInfo)"
@click="updateProject"
>
Speichern
</UButton>