WFDASH-WEBAPP/src/app
SJCoetz aea1ab67f3 fix(po-send): push dashboardBaseUrl + outcomeUrl on n8n webhook body
The n8n Code node that posts the SMTP outcome back to the
/api/v1/purchase-orders/[id]/send-email/outcome route couldn't
read env vars at runtime (N8N_BLOCK_ENV_ACCESS_IN_NODE=true in
docker-compose), so it composed the callback URL from fields on
the webhook body. The route never pushed dashboardBaseUrl or
outcomeUrl, so n8n fell back to a relative URL, the request
died, n8n returned HTTP 500, and the route flipped the PO to
mail_failed with a misleading '[webhook] Webhook returned HTTP
500' message.

DASHBOARD_URL is already defined in .env (labelled 'used by n8n
workflows to call back into this app') — the route just never
read it. Now the route pushes both the dashboard base and a
pre-built absolute outcome URL, trimmed of trailing slashes, and
omitted (not empty) when DASHBOARD_URL is unset so the existing
'missing' branch in n8n fires clearly.

A new test file asserts all three cases: with DASHBOARD_URL,
with a trailing slash, and without the env var.

Co-Authored-By: Claude <noreply@anthropic.com>

Co-authored-by: Orca <help@stably.ai>
2026-08-03 11:23:40 +02:00
..
(app) feat: collection-map updates, todays-stops, quote/approval rework, buyer-tasks, e2e 2026-08-03 09:33:45 +02:00
(auth) feat: collection-map updates, todays-stops, quote/approval rework, buyer-tasks, e2e 2026-08-03 09:33:45 +02:00
api fix(po-send): push dashboardBaseUrl + outcomeUrl on n8n webhook body 2026-08-03 11:23:40 +02:00
favicon.ico feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
globals.css feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
layout.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
offline.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
page.tsx feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00