Skip to content

Commit 67229e5

Browse files
benotternmetulev
authored andcommitted
Fixed unintentially sending dueDateTime (#80)
1 parent 1ab8b4d commit 67229e5

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/components/mgt-tasks/task-sources.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,13 @@ export class TodoTaskSource extends TaskSourceBase implements ITaskSource {
179179
}
180180

181181
public async addTask(newTask: ITask): Promise<any> {
182-
return await this.graph.todo_addTask({
182+
let task = {
183183
subject: newTask.name,
184184
assignedTo: plannerAssignmentsToTodoAssign(newTask.assignments),
185-
parentFolderId: newTask.immediateParentId,
186-
dueDateTime: {
187-
dateTime: newTask.dueDate,
188-
timeZone: 'UTC'
189-
}
190-
} as OutlookTask);
185+
parentFolderId: newTask.immediateParentId
186+
} as OutlookTask;
187+
if (newTask.dueDate) task.dueDateTime = { dateTime: newTask.dueDate, timeZone: 'UTC' };
188+
return await this.graph.todo_addTask(task);
191189
}
192190
public async removeTask(id: string, eTag: string): Promise<any> {
193191
return await this.graph.todo_removeTask(id, eTag);

0 commit comments

Comments
 (0)