Added IMS token changes.

This commit is contained in:
Patrick Fic
2022-05-11 16:31:09 -07:00
parent bbf908e5e1
commit 55144bd621
12 changed files with 65 additions and 17 deletions

View File

@@ -7,8 +7,12 @@ export const handleUpload = async ({ ev, context }) => {
const { onError, onSuccess, onProgress, file } = 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 });
},
@@ -22,7 +26,6 @@ export const handleUpload = async ({ ev, context }) => {
formData.append("vendorid", vendorid);
}
formData.append("file", file);
const bodyshop = store.getState().user.bodyshop;
const imexMediaServerResponse = await cleanAxios.post(
normalizeUrl(

View File

@@ -39,11 +39,15 @@ export function JobsDocumentsLocalGalleryReassign({
setLoading(true);
const selectedDocuments = allMedia[jobid].filter((m) => m.isSelected);
await cleanAxios.post(`${bodyshop.localmediaserverhttp}/jobs/move`, {
from_jobid: jobid,
jobid: newJobid,
files: selectedDocuments.map((f) => f.filename),
});
await cleanAxios.post(
`${bodyshop.localmediaserverhttp}/jobs/move`,
{
from_jobid: jobid,
jobid: newJobid,
files: selectedDocuments.map((f) => f.filename),
},
{ headers: { ims_token: bodyshop.localmediatoken } }
);
getJobMedia(jobid);
setVisible(false);

View File

@@ -603,6 +603,12 @@ export default function ShopInfoGeneral({ form }) {
>
<Input />
</Form.Item>
<Form.Item
name={["localmediatoken"]}
label={t("bodyshop.fields.localmediatoken")}
>
<Input />
</Form.Item>
</LayoutFormRow>
<LayoutFormRow grow header={t("bodyshop.labels.messagingpresets")}>
<Form.List name={["md_messaging_presets"]}>