I created an object and filled it with some properties using Object.defineProperty then fed that object as an argument for Angular's http.put but for some reason the back end is receiving an empty body.
let newData = {};
Object.defineProperty(newData, 'newTitle', {
value: this.taskForm.value.title,
});
Object.defineProperty(newData, 'newDescription', {
value: this.taskForm.value.description,
});
Object.defineProperty(newData, 'newSubtasks', {
value: this.taskForm.value.subtasks,
});
this.http.editTask(this.taskId, newData).subscribe();
editTask implementation
editTask(taskId: string, data: any) {
return this.http.put(`http://localhost:3000/edittask/${taskId}`, data);
}