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

@@ -9,22 +9,23 @@ export function* onSetJobMedia() {
}
export function* getJobMedia({ payload: jobid }) {
try {
const localmediaserverhttp = (yield select(
(state) => state.user.bodyshop.localmediaserverhttp
)).trim();
const bodyshop = yield select((state) => state.user.bodyshop);
const localmediaserverhttp = bodyshop.localmediaserverhttp.trim();
if (localmediaserverhttp && localmediaserverhttp !== "") {
const imagesFetch = yield cleanAxios.post(
`${localmediaserverhttp}/jobs/list`,
{
jobid,
}
},
{ headers: { ims_token: bodyshop.localmediatoken } }
);
const documentsFetch = yield cleanAxios.post(
`${localmediaserverhttp}/bills/list`,
{
jobid,
}
},
{ headers: { ims_token: bodyshop.localmediatoken } }
);
yield put(
@@ -66,9 +67,8 @@ export function* onSetBillMedia() {
}
export function* getBillMedia({ payload: { jobid, invoice_number } }) {
try {
const localmediaserverhttp = (yield select(
(state) => state.user.bodyshop.localmediaserverhttp
)).trim();
const bodyshop = yield select((state) => state.user.bodyshop);
const localmediaserverhttp = bodyshop.localmediaserverhttp.trim();
if (localmediaserverhttp && localmediaserverhttp !== "") {
const documentsFetch = yield cleanAxios.post(
@@ -76,7 +76,8 @@ export function* getBillMedia({ payload: { jobid, invoice_number } }) {
{
jobid,
invoice_number,
}
},
{ headers: { ims_token: bodyshop.localmediatoken } }
);
yield put(