[MNT-22051] - Fix form field mapping when value is zero (#6517)

* [MNT-22051] - Fix form field mapping when value is zero

* PR changes

* add validation for null
This commit is contained in:
Silviu Popa
2021-01-19 15:57:20 +02:00
committed by GitHub
parent 885792ba01
commit 98705109e1
5 changed files with 85 additions and 22 deletions

View File

@@ -23,7 +23,11 @@ export class TaskVariableCloud {
constructor(obj) {
this.id = obj.name || null;
this.name = obj.name || null;
this.value = obj.value || null;
this.value = this.hasValue(obj) ? obj.value : null;
this.type = obj.type || null;
}
hasValue(obj: TaskVariableCloud): boolean {
return typeof obj.value !== undefined && obj.value !== null;
}
}