Browse Source

Learning error: Can't find Analytic Unit with id undefined #83 (#84)

pull/1/head
rozetko 7 years ago committed by GitHub
parent
commit
c39da06c6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      server/src/routes/segments_router.ts

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

Loading…
Cancel
Save