diff --git a/src/components/Componentes/error-toast.tsx b/src/components/Componentes/error-toast.tsx
index dc0c342..a1b4677 100644
--- a/src/components/Componentes/error-toast.tsx
+++ b/src/components/Componentes/error-toast.tsx
@@ -1,6 +1,7 @@
"use client";
import { useEffect, useState } from "react";
+import { createPortal } from "react-dom";
import { Ic } from "@/icons";
type ErrorToastProps = {
@@ -48,7 +49,9 @@ export default function ErrorToast({
}
};
- return (
+ if (typeof document === "undefined") return null;
+
+ return createPortal(
-
+ ,
+ document.body,
);
}
diff --git a/src/components/Componentes/question-file.tsx b/src/components/Componentes/question-file.tsx
index 7bce970..b662781 100644
--- a/src/components/Componentes/question-file.tsx
+++ b/src/components/Componentes/question-file.tsx
@@ -417,7 +417,7 @@ export function QuestionFile({
source: pickerSource as any,
picker_type: pickerType as any,
returnAs: "upload",
- uploadUrl: `${process.env.NEXT_PUBLIC_API_BASE_URL ?? ""}/upload-tmp-media/`,
+ uploadUrl: `${window.location.origin}/api/proxy?__proxyPath=/upload-tmp-media/`,
fieldName: "file",
allowedExtensions: extensions,
maxBytes: 10_485_760, // 10 MB
diff --git a/src/components/Componentes/question-photo.tsx b/src/components/Componentes/question-photo.tsx
index bad1619..97f6b9a 100644
--- a/src/components/Componentes/question-photo.tsx
+++ b/src/components/Componentes/question-photo.tsx
@@ -257,7 +257,7 @@ export function QuestionPhoto({
source: pickerSource as any,
picker_type: pickerType as any,
returnAs: "upload",
- uploadUrl: `${process.env.NEXT_PUBLIC_API_BASE_URL ?? ""}/upload-tmp-media/`,
+ uploadUrl: `${window.location.origin}/api/proxy?__proxyPath=/upload-tmp-media/`,
fieldName: "file",
allowedExtensions:
extensions.length > 0 ? extensions : ["jpg", "jpeg", "png", "webp"],