From 809f5a007cffc4e70eee5a96551c25fd73b4c147 Mon Sep 17 00:00:00 2001 From: ingalls Date: Wed, 16 Oct 2024 13:27:13 -0600 Subject: [PATCH] Rework Connection COT --- api/routes/connection-layer-cot.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/routes/connection-layer-cot.ts b/api/routes/connection-layer-cot.ts index f525294b8..9b618ed63 100644 --- a/api/routes/connection-layer-cot.ts +++ b/api/routes/connection-layer-cot.ts @@ -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)}`); } } @@ -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) { @@ -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) } } } @@ -167,7 +167,6 @@ export default async function router(schema: Schema, config: Config) { })); } - res.json({ status: errors.length ? 400 : 200, message: 'Submitted',