Added Video support for document upload. IO-524
This commit is contained in:
@@ -7,6 +7,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import { DELETE_DOCUMENT } from "../../graphql/documents.queries";
|
||||
import cleanAxios from "../../utils/CleanAxios";
|
||||
import { DetermineFileType } from "../documents-upload/documents-upload.utility";
|
||||
//Context: currentUserEmail, bodyshop, jobid, invoiceid
|
||||
|
||||
export default function JobsDocumentsDeleteButton({
|
||||
@@ -20,6 +21,7 @@ export default function JobsDocumentsDeleteButton({
|
||||
...galleryImages.other.filter((image) => image.isSelected),
|
||||
];
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const handleDelete = () => {
|
||||
logImEXEvent("job_documents_delete", { count: imagesToDelete.length });
|
||||
setLoading(true);
|
||||
@@ -45,7 +47,9 @@ export default function JobsDocumentsDeleteButton({
|
||||
|
||||
cleanAxios
|
||||
.post(
|
||||
`${process.env.REACT_APP_CLOUDINARY_ENDPOINT}/destroy`,
|
||||
`${process.env.REACT_APP_CLOUDINARY_ENDPOINT}/${DetermineFileType(
|
||||
image.type
|
||||
)}/destroy`,
|
||||
formData,
|
||||
options
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user