fix(roads): split parameterized queries into individual statements to satisfy node-postgres prepared statement rule
This commit is contained in:
@@ -228,14 +228,14 @@ export class RoadRefinementController {
|
|||||||
`);
|
`);
|
||||||
|
|
||||||
// 2. Direct insert into approved_roads immediately (Delete existing first to ensure idempotency)
|
// 2. Direct insert into approved_roads immediately (Delete existing first to ensure idempotency)
|
||||||
|
await this.dataSource.query(`DELETE FROM approved_roads WHERE candidate_id = $1::uuid`, [id]);
|
||||||
await this.dataSource.query(`
|
await this.dataSource.query(`
|
||||||
DELETE FROM approved_roads WHERE candidate_id = $1::uuid;
|
|
||||||
INSERT INTO approved_roads (
|
INSERT INTO approved_roads (
|
||||||
candidate_id, geometry, name, highway, confidence, "uniqueDriverCount", oneway, approved_at
|
candidate_id, geometry, name, highway, confidence, "uniqueDriverCount", oneway, approved_at
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
id, geometry::geometry, COALESCE(name, 'Unnamed Road'), COALESCE(highway, 'residential'), confidence, "uniqueDriverCount", COALESCE(oneway, 0), NOW()
|
id, geometry::geometry, COALESCE(name, 'Unnamed Road'), COALESCE(highway, 'residential'), confidence, "uniqueDriverCount", COALESCE(oneway, 0), NOW()
|
||||||
FROM candidate_roads WHERE id = $1::uuid;
|
FROM candidate_roads WHERE id = $1::uuid
|
||||||
`, [id]);
|
`, [id]);
|
||||||
|
|
||||||
// 3. Mark candidate as approved
|
// 3. Mark candidate as approved
|
||||||
|
|||||||
Reference in New Issue
Block a user