Some Changes
This commit is contained in:
@@ -151,7 +151,16 @@ const projectHours = () => {
|
|||||||
return hours.toFixed(2)
|
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 () => {
|
const createProject = async () => {
|
||||||
let initialPhases = projecttypes.value.find(i => i.id === itemInfo.value.projecttype).initialPhases
|
let initialPhases = projecttypes.value.find(i => i.id === itemInfo.value.projecttype).initialPhases
|
||||||
@@ -245,7 +254,7 @@ const renderedPhases = computed(() => {
|
|||||||
<template #right>
|
<template #right>
|
||||||
<UButton
|
<UButton
|
||||||
v-if="mode === 'edit'"
|
v-if="mode === 'edit'"
|
||||||
@click="dataStore.updateItem('projects',itemInfo,oldItemInfo)"
|
@click="updateProject"
|
||||||
>
|
>
|
||||||
Speichern
|
Speichern
|
||||||
</UButton>
|
</UButton>
|
||||||
|
|||||||
Reference in New Issue
Block a user