From bacf4c27f5254b09cbcacfd9896d8e461984e46f Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Fri, 31 May 2019 18:31:19 -0700 Subject: [PATCH] Don't reuse task ID --- lib/ui/api-functions.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ui/api-functions.ts b/lib/ui/api-functions.ts index 9060896..28b8466 100644 --- a/lib/ui/api-functions.ts +++ b/lib/ui/api-functions.ts @@ -72,7 +72,10 @@ export async function postTasks( tasks, timeout ): Promise<{ connectionRequest: string; tasks: any[] }> { - for (const task of tasks) task.device = deviceId; + for (const task of tasks) { + delete task._id; + task.device = deviceId; + } tasks = await insertTasks(tasks); const statuses = tasks.map(t => {