This commit is contained in:
Kenneth Jannette
2024-01-17 11:14:18 -06:00
parent f697539fc0
commit e4fdf1586d

View File

@@ -35,7 +35,10 @@ const UploadModal = (props) => {
const [docError, setShowDocError] = useState(""); const [docError, setShowDocError] = useState("");
const fileTypes = ["PDF"]; const fileTypes = ["PDF"];
const fileName = fileToParse ? fileToParse.name : undefined; const fileName = fileToParse ? fileToParse.name : undefined;
const baseUrl = "http://localhost:4000"; const apiUrl =
process.env.NODE_ENV === "development"
? process.env.REACT_APP_API_DEV
: process.env.REACT_APP_API_PROD;
const navigate = useNavigate(); const navigate = useNavigate();
async function saveToDb(uuidName) { async function saveToDb(uuidName) {
@@ -67,7 +70,7 @@ const UploadModal = (props) => {
async function uploadFile(file) { async function uploadFile(file) {
try { try {
const response = await fetch(`${baseUrl}/parseNewDoc`, { const response = await fetch(`${apiUrl}/parseNewDoc`, {
method: "POST", method: "POST",
body: file, body: file,
}); });