refactor(web): replace instances of BACKEND_URL with buildBackendUrl for improved URL handling

This commit is contained in:
Anish Sarkar 2026-06-16 14:51:25 +05:30
parent 371ff866c7
commit 3f69bfd5e4
21 changed files with 98 additions and 95 deletions

View file

@ -7,7 +7,7 @@ import { Button } from "@/components/ui/button";
import { Spinner } from "@/components/ui/spinner";
import { documentsApiService } from "@/lib/apis/documents-api.service";
import { authenticatedFetch } from "@/lib/auth-utils";
import { BACKEND_URL } from "@/lib/env-config";
import { buildBackendUrl } from "@/lib/env-config";
interface DownloadOriginalButtonProps {
documentId: number;
@ -41,7 +41,7 @@ export function DownloadOriginalButton({ documentId }: DownloadOriginalButtonPro
setDownloading(true);
try {
const response = await authenticatedFetch(
`${BACKEND_URL}/api/v1/documents/${documentId}/download-original`,
buildBackendUrl(`/api/v1/documents/${documentId}/download-original`),
{ method: "GET" }
);
if (!response.ok) throw new Error("Download failed");