more
This commit is contained in:
@@ -40,7 +40,7 @@ const UploadModal = (props) => {
|
|||||||
process.env.NODE_ENV === "development"
|
process.env.NODE_ENV === "development"
|
||||||
? process.env.REACT_APP_API_DEV
|
? process.env.REACT_APP_API_DEV
|
||||||
: process.env.REACT_APP_API_PROD;
|
: process.env.REACT_APP_API_PROD;
|
||||||
|
console.log("apiUrl", apiUrl);
|
||||||
async function saveToDb(uuidName) {
|
async function saveToDb(uuidName) {
|
||||||
const createdAt = new Date();
|
const createdAt = new Date();
|
||||||
const data = {
|
const data = {
|
||||||
@@ -69,16 +69,13 @@ const UploadModal = (props) => {
|
|||||||
setFileToParse(file);
|
setFileToParse(file);
|
||||||
setFileChanged(true);
|
setFileChanged(true);
|
||||||
}
|
}
|
||||||
|
console.log("full request url:", `${apiUrl}/parseNewDoc`);
|
||||||
async function uploadFile(file) {
|
async function uploadFile(file) {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
const response = await fetch(`${apiUrl}/parseNewDoc`, {
|
||||||
`https://www.novodraft.ai:4000/parseNewDoc`,
|
method: "POST",
|
||||||
{
|
body: file,
|
||||||
method: "POST",
|
});
|
||||||
body: file,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
const res = response;
|
const res = response;
|
||||||
return res;
|
return res;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ export const DocCard = (props) => {
|
|||||||
createdAt,
|
createdAt,
|
||||||
} = props;
|
} = props;
|
||||||
const now = new Date().getTime();
|
const now = new Date().getTime();
|
||||||
const uploadedAt = createdAt.toDate();
|
const uploadedAt = createdAt ? createdAt.toDate() : new Date().getTime();
|
||||||
const isReportable = Math.round((now - uploadedAt) / 60 / 1000) > 15;
|
const isReportable = Math.round((now - uploadedAt) / 60 / 1000) > 15;
|
||||||
const disabled = docType ? false : true;
|
const disabled = docType ? false : true;
|
||||||
const tooltipText =
|
const tooltipText =
|
||||||
|
|||||||
@@ -199,7 +199,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 90px;
|
width: 120px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
|
|||||||
Reference in New Issue
Block a user