fix(explorer): make distance intelligence API calls slash-safe

This commit is contained in:
Zohaib Hassnain
2026-04-29 21:17:36 +05:00
parent b6373204e2
commit e3a3f6010b
5 changed files with 291 additions and 58 deletions
@@ -510,8 +510,13 @@ export function GraphWorkspaceShell() {
if (!selectedNodeId || !pathTargetId.trim()) return;
try {
const pathParams = new URLSearchParams({
source: selectedNodeId,
target: pathTargetId.trim(),
algorithm: "dijkstra",
});
const response = await fetch(
`/api/graph/node/${encodeURIComponent(selectedNodeId)}/path?target=${encodeURIComponent(pathTargetId.trim())}&algorithm=dijkstra`,
`/api/graph/path?${pathParams.toString()}`,
);
if (!response.ok) {
throw new Error(`Path lookup failed with status ${response.status}`);