Skip to content

Commit

Permalink
Rework Connection COT
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Oct 16, 2024
1 parent 3e776a5 commit 809f5a0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions api/routes/connection-layer-cot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default async function router(schema: Schema, config: Config) {
error: err instanceof Error ? err.message : String(err),
feature: feat
})

console.error(`Failed to decode ${String(err)}: feature: ${JSON.stringify(feat)}`);
}
}
Expand Down Expand Up @@ -128,6 +129,7 @@ export default async function router(schema: Schema, config: Config) {
existMap.set(String(feat.id), feat);
}


for (const cot of cots) {
const exist = existMap.get(cot.uid());
if (exist && data.mission_diff) {
Expand All @@ -136,12 +138,10 @@ export default async function router(schema: Schema, config: Config) {
}

cot.addDest({ mission: data.name, path: `layer-${layer.id}`, after: '' });
cots.push(cot)
}
} else {
for (const cot of cots) {
cot.addDest({ mission: data.name });
cots.push(cot)
}
}
}
Expand All @@ -167,7 +167,6 @@ export default async function router(schema: Schema, config: Config) {
}));
}


res.json({
status: errors.length ? 400 : 200,
message: 'Submitted',
Expand Down

0 comments on commit 809f5a0

Please sign in to comment.