Add IMS Token.

This commit is contained in:
Patrick Fic
2022-05-12 16:32:28 -07:00
parent 451950883a
commit 577eaf55ee
6 changed files with 24 additions and 19 deletions

View File

@@ -7,9 +7,13 @@ import * as ImageManipulator from "expo-image-manipulator";
export const handleLocalUpload = async ({ ev, context }) => {
const { onError, onSuccess, onProgress, filename, mediaId } = ev;
const { jobid, invoice_number, vendorid, callbackAfterUpload } = context;
const bodyshop = store.getState().user.bodyshop;
var options = {
headers: { "X-Requested-With": "XMLHttpRequest" },
headers: {
"X-Requested-With": "XMLHttpRequest",
ims_token: bodyshop.localmediatoken,
},
onUploadProgress: (e) => {
if (onProgress) onProgress({ percent: (e.loaded / e.total) * 100 });
},
@@ -57,7 +61,6 @@ export const handleLocalUpload = async ({ ev, context }) => {
}
formData.append("file", fileData);
const bodyshop = store.getState().user.bodyshop;
try {
const imexMediaServerResponse = await axios.post(