diff --git a/client/src/components/documents-upload/documents-upload.container.jsx b/client/src/components/documents-upload/documents-upload.container.jsx index 9d83aac1d..0b0fe4615 100644 --- a/client/src/components/documents-upload/documents-upload.container.jsx +++ b/client/src/components/documents-upload/documents-upload.container.jsx @@ -68,7 +68,7 @@ export function DocumentsUploadContainer({ let timestamp = Math.floor(Date.now() / 1000); let public_id = fileName; let tags = `${bodyshop.textid},${ - tagsArray ? tagsArray.map((tag) => `{tag},`) : "" + tagsArray ? tagsArray.map((tag) => `${tag},`) : "" }`; let eager = "w_200,h_200,c_thumb"; axios @@ -110,8 +110,6 @@ export function DocumentsUploadContainer({ { jobid: jobId, uploaded_by: currentUser.email, - url: "c", - thumb_url: "c", key: fileName, invoiceid: invoiceId, type: fileType, @@ -121,10 +119,8 @@ export function DocumentsUploadContainer({ }).then((r) => { onSuccess({ uid: r.data.insert_documents.returning[0].id, - url: r.data.insert_documents.returning[0].thumb_url, name: r.data.insert_documents.returning[0].name, status: "done", - full_url: r.data.insert_documents.returning[0].url, key: r.data.insert_documents.returning[0].key, }); notification["success"]({ diff --git a/client/src/components/jobs-documents-gallery/jobs-document-gallery.download.component.jsx b/client/src/components/jobs-documents-gallery/jobs-document-gallery.download.component.jsx index 29b882255..30b64f26d 100644 --- a/client/src/components/jobs-documents-gallery/jobs-document-gallery.download.component.jsx +++ b/client/src/components/jobs-documents-gallery/jobs-document-gallery.download.component.jsx @@ -1,7 +1,7 @@ -import { Button, notification } from "antd"; +import { Button } from "antd"; +import axios from "axios"; import React from "react"; import { useTranslation } from "react-i18next"; -import axios from "axios"; export default function JobsDocumentsDownloadButton({ galleryImages }) { const { t } = useTranslation(); diff --git a/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx b/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx index b975c7fd1..3ec6d4f6b 100644 --- a/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx +++ b/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx @@ -11,13 +11,11 @@ function JobsDocumentsComponent({ data, jobId, refetch }) { setgalleryImages( data.reduce((acc, value) => { acc.push({ - src: value.url, - thumbnail: `${ - process.env.REACT_APP_CLOUDINARY_IMAGE_ENDPOINT - }/h_200,w_200,c_thumb/${value.key}${ - value.type.includes("pdf") ? ".jpg" : "" - }`, - tags: value.type.includes("pdf") ? [{ value: "PDF" }] : [], + src: `${process.env.REACT_APP_CLOUDINARY_IMAGE_ENDPOINT}/${value.key}.jpg`, + thumbnail: `${process.env.REACT_APP_CLOUDINARY_IMAGE_ENDPOINT}/h_200,w_200,c_thumb/${value.key}.jpg`, + tags: value.type.includes("pdf") + ? [{ value: "PDF", title: "PDF" }] + : [], thumbnailHeight: 200, thumbnailWidth: 200, isSelected: false, @@ -31,7 +29,11 @@ function JobsDocumentsComponent({ data, jobId, refetch }) { return (
- +