more
This commit is contained in:
@@ -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,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user