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 = {