diff --git a/frontend/src/components/ui/separator.tsx b/frontend/src/components/ui/separator.tsx new file mode 100644 index 0000000..804ffa6 --- /dev/null +++ b/frontend/src/components/ui/separator.tsx @@ -0,0 +1,31 @@ +/** + * Separator component (#1498). + * + * `app/document/[id]/page.tsx` imported `@/components/ui/separator`, which did + * not exist and broke the build. This provides the missing component. + */ +import * as React from "react"; + +export interface SeparatorProps extends React.HTMLAttributes { + orientation?: "horizontal" | "vertical"; +} + +export const Separator = React.forwardRef( + ({ orientation = "horizontal", className = "", ...props }, ref) => ( +
+ ), +); + +Separator.displayName = "Separator"; + +export default Separator; diff --git a/frontend/src/lib/api-version.ts b/frontend/src/lib/api-version.ts new file mode 100644 index 0000000..39ab3c1 --- /dev/null +++ b/frontend/src/lib/api-version.ts @@ -0,0 +1,20 @@ +/** + * Versioned API URL helpers (#1499). + * + * 26 fetch call sites in 9 pages used unversioned `/api/...` URLs, while the + * backend serves `/api/v1/...`. These helpers build versioned URLs so call + * sites stop drifting and pick up the version in one place. + */ +export const API_VERSION = "v1"; + +const RAW_BASE = process.env.NEXT_PUBLIC_API_URL ?? ""; + +/** Base URL including the API version, e.g. `https://host/api/v1`. */ +export function apiBaseUrl(): string { + return `${RAW_BASE.replace(/\/+$/, "")}/api/${API_VERSION}`; +} + +/** Build a versioned API URL from a path such as `/disputes/1`. */ +export function apiUrl(path: string): string { + return `${apiBaseUrl()}/${path.replace(/^\/+/, "")}`; +}