Files
silo-server/web/src/lib/pluginRouteHref.ts
T

8 lines
443 B
TypeScript
Raw Normal View History

2026-05-22 20:26:11 -04:00
// Build a navigable URL for a plugin route. The descriptor's `path` is a route
// pattern (it may end in `/*` to mark a prefix-matched range), not a URL — we
// strip the trailing wildcard before composing the installation-scoped href.
export function pluginRouteHref(installationId: number, path: string): string {
const trimmed = path.endsWith("/*") ? path.slice(0, -2) : path;
return `/api/v1/plugins/${installationId}${trimmed}`;
}