fix(parcel-sync): quote all CSV fields + layer feature counts + drumul de azi
- CSV export: all fields properly quoted to prevent column misalignment when values contain commas (e.g. nrTopo with multiple topo numbers) - Layer catalog: 'Numara toate' button fetches feature count per layer via /api/eterra/layers/summary (now supports session auth) - Feature counts displayed as badges on each layer and category total - 'Drumul de azi' section: persists today's layer counts in localStorage grouped by SIRUTA with timestamps
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
} from "@/modules/parcel-sync/services/eterra-client";
|
||||
import { LAYER_CATALOG } from "@/modules/parcel-sync/services/eterra-layers";
|
||||
import { fetchUatGeometry } from "@/modules/parcel-sync/services/uat-geometry";
|
||||
import { getSessionCredentials } from "@/modules/parcel-sync/services/session-store";
|
||||
|
||||
export const runtime = "nodejs";
|
||||
export const dynamic = "force-dynamic";
|
||||
@@ -18,19 +19,17 @@ type Body = {
|
||||
|
||||
/**
|
||||
* POST — Count features per layer on the remote eTerra server.
|
||||
* Supports session-based auth (falls back to env vars).
|
||||
*/
|
||||
export async function POST(req: Request) {
|
||||
try {
|
||||
const body = (await req.json()) as Body;
|
||||
const username = (
|
||||
body.username ??
|
||||
process.env.ETERRA_USERNAME ??
|
||||
""
|
||||
const session = getSessionCredentials();
|
||||
const username = String(
|
||||
body.username || session?.username || process.env.ETERRA_USERNAME || "",
|
||||
).trim();
|
||||
const password = (
|
||||
body.password ??
|
||||
process.env.ETERRA_PASSWORD ??
|
||||
""
|
||||
const password = String(
|
||||
body.password || session?.password || process.env.ETERRA_PASSWORD || "",
|
||||
).trim();
|
||||
const siruta = String(body.siruta ?? "").trim();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user