fix: Delete WEAs by both Name and UUID on Save
Deploy Standortplaner / deploy (push) Successful in 17s
Details
Deploy Standortplaner / deploy (push) Successful in 17s
Details
This commit is contained in:
parent
bd30641ba5
commit
60748049ea
|
|
@ -234,9 +234,12 @@ app.post('/api/wea', async (req, res) => {
|
||||||
await client.query('BEGIN');
|
await client.query('BEGIN');
|
||||||
|
|
||||||
// 1. Bestehende WEAs für dieses Projekt löschen
|
// 1. Bestehende WEAs für dieses Projekt löschen
|
||||||
|
const projectName = await resolveProjectName(client, targetProject);
|
||||||
|
const resolvedPid = await resolveProjectId(client, targetProject);
|
||||||
|
|
||||||
const delRes = await client.query(
|
const delRes = await client.query(
|
||||||
`DELETE FROM ${schema}.wea_standorte WHERE projekt_id = $1`,
|
`DELETE FROM ${schema}.wea_standorte WHERE projekt_id = $1 OR projekt_id = $2 OR projekt_id = $3`,
|
||||||
[targetProject]
|
[targetProject, resolvedPid, projectName]
|
||||||
);
|
);
|
||||||
log(`Gelöscht: ${delRes.rowCount} bestehende Anlagen.`);
|
log(`Gelöscht: ${delRes.rowCount} bestehende Anlagen.`);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue