Resolved CORS errors for document upload BOD-407
This commit is contained in:
@@ -5,8 +5,12 @@ import { client } from "../../App/App.container";
|
||||
import { INSERT_NEW_DOCUMENT } from "../../graphql/documents.queries";
|
||||
import i18n from "i18next";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
|
||||
import { axiosAuthInterceptorId } from "../../App/App.container";
|
||||
//Context: currentUserEmail, bodyshop, jobid, invoiceid
|
||||
|
||||
var cleanAxios = axios.create();
|
||||
cleanAxios.interceptors.request.eject(axiosAuthInterceptorId);
|
||||
|
||||
export const handleUpload = (ev, context) => {
|
||||
console.log("ev", ev);
|
||||
|
||||
@@ -102,12 +106,10 @@ export const uploadToS3 = (
|
||||
formData.append("timestamp", timestamp);
|
||||
formData.append("signature", signature);
|
||||
|
||||
axios
|
||||
.post(
|
||||
`${process.env.REACT_APP_CLOUDINARY_ENDPOINT}/upload`,
|
||||
formData,
|
||||
options
|
||||
)
|
||||
cleanAxios
|
||||
.post(`${process.env.REACT_APP_CLOUDINARY_ENDPOINT}/upload`, formData, {
|
||||
...options,
|
||||
})
|
||||
.then((response) => {
|
||||
console.log("Upload Response", response);
|
||||
client
|
||||
|
||||
@@ -6,6 +6,12 @@ import { useMutation } from "@apollo/react-hooks";
|
||||
import { DELETE_DOCUMENT } from "../../graphql/documents.queries";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
|
||||
import { axiosAuthInterceptorId } from "../../App/App.container";
|
||||
//Context: currentUserEmail, bodyshop, jobid, invoiceid
|
||||
|
||||
var cleanAxios = axios.create();
|
||||
cleanAxios.interceptors.request.eject(axiosAuthInterceptorId);
|
||||
|
||||
export default function JobsDocumentsDeleteButton({
|
||||
galleryImages,
|
||||
deletionCallback,
|
||||
@@ -37,7 +43,7 @@ export default function JobsDocumentsDeleteButton({
|
||||
formData.append("timestamp", timestamp);
|
||||
formData.append("signature", signature);
|
||||
|
||||
axios
|
||||
cleanAxios
|
||||
.post(
|
||||
`${process.env.REACT_APP_CLOUDINARY_ENDPOINT}/destroy`,
|
||||
formData,
|
||||
|
||||
Reference in New Issue
Block a user