From c39da06c6a8c5426bdb451ebb5fc4b1ccf924821 Mon Sep 17 00:00:00 2001 From: rozetko Date: Wed, 18 Jul 2018 19:55:17 +0300 Subject: [PATCH] Learning error: Can't find Analytic Unit with id undefined #83 (#84) --- server/src/routes/segments_router.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/routes/segments_router.ts b/server/src/routes/segments_router.ts index 3c88864..7315171 100644 --- a/server/src/routes/segments_router.ts +++ b/server/src/routes/segments_router.ts @@ -40,11 +40,11 @@ async function sendSegments(ctx: Router.IRouterContext) { async function updateSegments(ctx: Router.IRouterContext) { try { let segmentsUpdate = ctx.request.body; - let key = segmentsUpdate.analyticUnitKey; - let addedIds = insertSegments(key, segmentsUpdate.addedSegments, true); - removeSegments(key, segmentsUpdate.removedSegments); + let id = segmentsUpdate.id; + let addedIds = insertSegments(id, segmentsUpdate.addedSegments, true); + removeSegments(id, segmentsUpdate.removedSegments); ctx.response.body = { addedIds }; - runLearning(key); + runLearning(id); } catch(e) { ctx.response.status = 500; ctx.response.body = {