diff --git a/frontend/src/app/components/keyresult-dialog/keyresult-dialog.component.ts b/frontend/src/app/components/keyresult-dialog/keyresult-dialog.component.ts index 7ae3e943d0..92b5445f2b 100644 --- a/frontend/src/app/components/keyresult-dialog/keyresult-dialog.component.ts +++ b/frontend/src/app/components/keyresult-dialog/keyresult-dialog.component.ts @@ -52,15 +52,15 @@ export class KeyresultDialogComponent { saveKeyResult(openNewDialog = false) { const value = this.keyResultForm.value; const keyResult = this.isMetricKeyResult() - ? ({ + ? { ...value, objective: this.data.objective - } as KeyResultMetricDTO) - : ({ + } as KeyResultMetricDTO + : { ...value, objective: this.data.objective, id: this.data.keyResult?.id - } as KeyResultOrdinalDTO); + } as KeyResultOrdinalDTO; keyResult.id = this.data.keyResult?.id; keyResult.version = this.data.keyResult?.version; keyResult.actionList = (keyResult.actionList ?? []).filter((action: Action) => action.action !== '');