mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-27 19:25:15 +02:00
Merge pull request #1418 from VarunShukla07/fix/env-config-tool-ui-generators
refactor(env): replace inline process.env reads with BACKEND_URL in tool-ui generators
This commit is contained in:
commit
54716105d2
3 changed files with 6 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ import {
|
||||||
import { baseApiService } from "@/lib/apis/base-api.service";
|
import { baseApiService } from "@/lib/apis/base-api.service";
|
||||||
import { authenticatedFetch } from "@/lib/auth-utils";
|
import { authenticatedFetch } from "@/lib/auth-utils";
|
||||||
import { clearActivePodcastTaskId, setActivePodcastTaskId } from "@/lib/chat/podcast-state";
|
import { clearActivePodcastTaskId, setActivePodcastTaskId } from "@/lib/chat/podcast-state";
|
||||||
|
import { BACKEND_URL } from "@/lib/env-config";
|
||||||
/**
|
/**
|
||||||
* Zod schemas for runtime validation
|
* Zod schemas for runtime validation
|
||||||
*/
|
*/
|
||||||
|
|
@ -194,7 +194,7 @@ function PodcastPlayer({
|
||||||
// Authenticated view - fetch audio and details in parallel
|
// Authenticated view - fetch audio and details in parallel
|
||||||
const [audioResponse, details] = await Promise.all([
|
const [audioResponse, details] = await Promise.all([
|
||||||
authenticatedFetch(
|
authenticatedFetch(
|
||||||
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/podcasts/${podcastId}/audio`,
|
`${BACKEND_URL}/api/v1/podcasts/${podcastId}/audio`,
|
||||||
{ method: "GET", signal: controller.signal }
|
{ method: "GET", signal: controller.signal }
|
||||||
),
|
),
|
||||||
baseApiService.get<unknown>(`/api/v1/podcasts/${podcastId}`),
|
baseApiService.get<unknown>(`/api/v1/podcasts/${podcastId}`),
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import { Button } from "@/components/ui/button";
|
||||||
import { useMediaQuery } from "@/hooks/use-media-query";
|
import { useMediaQuery } from "@/hooks/use-media-query";
|
||||||
import { baseApiService } from "@/lib/apis/base-api.service";
|
import { baseApiService } from "@/lib/apis/base-api.service";
|
||||||
import { getAuthHeaders } from "@/lib/auth-utils";
|
import { getAuthHeaders } from "@/lib/auth-utils";
|
||||||
|
import { BACKEND_URL } from "@/lib/env-config";
|
||||||
|
|
||||||
pdfjsLib.GlobalWorkerOptions.workerSrc = new URL(
|
pdfjsLib.GlobalWorkerOptions.workerSrc = new URL(
|
||||||
"pdfjs-dist/build/pdf.worker.min.mjs",
|
"pdfjs-dist/build/pdf.worker.min.mjs",
|
||||||
|
|
@ -222,7 +223,7 @@ function ResumeCard({
|
||||||
const previewPath = shareToken
|
const previewPath = shareToken
|
||||||
? `/api/v1/public/${shareToken}/reports/${reportId}/preview`
|
? `/api/v1/public/${shareToken}/reports/${reportId}/preview`
|
||||||
: `/api/v1/reports/${reportId}/preview`;
|
: `/api/v1/reports/${reportId}/preview`;
|
||||||
setPdfUrl(`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}${previewPath}`);
|
setPdfUrl(`${BACKEND_URL}${previewPath}`);
|
||||||
|
|
||||||
if (autoOpen && isDesktop && !autoOpenedRef.current) {
|
if (autoOpen && isDesktop && !autoOpenedRef.current) {
|
||||||
autoOpenedRef.current = true;
|
autoOpenedRef.current = true;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import {
|
||||||
type CompiledSlide,
|
type CompiledSlide,
|
||||||
} from "./combined-player";
|
} from "./combined-player";
|
||||||
import { getPptxExportErrorToast, getVideoDownloadErrorToast } from "./errors";
|
import { getPptxExportErrorToast, getVideoDownloadErrorToast } from "./errors";
|
||||||
|
import { BACKEND_URL } from "@/lib/env-config";
|
||||||
|
|
||||||
const GenerateVideoPresentationArgsSchema = z.object({
|
const GenerateVideoPresentationArgsSchema = z.object({
|
||||||
source_content: z.string(),
|
source_content: z.string(),
|
||||||
|
|
@ -136,7 +137,7 @@ function VideoPresentationPlayer({
|
||||||
const [isPptxExporting, setIsPptxExporting] = useState(false);
|
const [isPptxExporting, setIsPptxExporting] = useState(false);
|
||||||
const [pptxProgress, setPptxProgress] = useState<string | null>(null);
|
const [pptxProgress, setPptxProgress] = useState<string | null>(null);
|
||||||
|
|
||||||
const backendUrl = process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL ?? "";
|
const backendUrl = BACKEND_URL ?? "";
|
||||||
const audioBlobUrlsRef = useRef<string[]>([]);
|
const audioBlobUrlsRef = useRef<string[]>([]);
|
||||||
|
|
||||||
const loadPresentation = useCallback(async () => {
|
const loadPresentation = useCallback(async () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue