fix: dynamic workspaceId for no-geometry scan (was hardcoded 65)
- resolveWorkspacePk chain: explicit param -> GisUat DB -> ArcGIS layer query - UI passes workspacePk from UAT selection to scan API - Fixes: FELEACU (Cluj, workspace!=65) returning 0 immovables - Better messaging: shows X total, Y with geometry, Z without - Shows warning when 0 immovables found (workspace resolution failed)
This commit is contained in:
@@ -272,6 +272,7 @@ export async function POST(req: Request) {
|
||||
phase = ph;
|
||||
updatePhaseProgress(done, tot);
|
||||
},
|
||||
// workspacePk will be auto-resolved from DB/ArcGIS inside the service
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -21,7 +21,10 @@ export const dynamic = "force-dynamic";
|
||||
|
||||
export async function POST(req: Request) {
|
||||
try {
|
||||
const body = (await req.json()) as { siruta?: string };
|
||||
const body = (await req.json()) as {
|
||||
siruta?: string;
|
||||
workspacePk?: number;
|
||||
};
|
||||
const siruta = String(body.siruta ?? "").trim();
|
||||
if (!/^\d+$/.test(siruta)) {
|
||||
return NextResponse.json(
|
||||
@@ -45,7 +48,9 @@ export async function POST(req: Request) {
|
||||
}
|
||||
|
||||
const client = await EterraClient.create(username, password);
|
||||
const result = await scanNoGeometryParcels(client, siruta);
|
||||
const result = await scanNoGeometryParcels(client, siruta, {
|
||||
workspacePk: body.workspacePk ?? null,
|
||||
});
|
||||
|
||||
return NextResponse.json(result);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user