Skip to content

Commit

Permalink
Implemented: added services tofetch carrier sepcific information(hotw…
Browse files Browse the repository at this point in the history
  • Loading branch information
ymaheshwari1 committed Dec 10, 2024
1 parent 601d538 commit 1b85b67
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions src/services/UtilService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import api from "@/api"
import api, { client } from "@/api"
import store from "@/store";

const fetchEnums = async (payload: any): Promise<any> => {
return api({
Expand Down Expand Up @@ -55,12 +56,46 @@ const checkOmsConnection = async (): Promise<any> => {
});
}

const getCarrierInformation = async (payload: any): Promise<any> => {
const omsRedirectionInfo = store.getters["user/getOmsRedirectionInfo"];
let baseURL = omsRedirectionInfo.url;
baseURL = baseURL && baseURL.startsWith("http") ? baseURL : `https://${baseURL}.hotwax.io/api/`;
return client({
url: "performFind",
method: "post",
baseURL: baseURL,
data: payload,
headers: {
Authorization: 'Bearer ' + omsRedirectionInfo.token,
'Content-Type': 'application/json'
}
});
}

const getCarrierDeliveryDays = async (payload: any): Promise<any> => {
const omsRedirectionInfo = store.getters["user/getOmsRedirectionInfo"];
let baseURL = omsRedirectionInfo.url;
baseURL = baseURL && baseURL.startsWith("http") ? baseURL : `https://${baseURL}.hotwax.io/api/`;
return client({
url: "performFind",
method: "post",
baseURL: baseURL,
data: payload,
headers: {
Authorization: 'Bearer ' + omsRedirectionInfo.token,
'Content-Type': 'application/json'
}
});
}

export const UtilService = {
checkOmsConnection,
fetchEnums,
fetchFacilities,
fetchFacilityGroups,
fetchOmsEnums,
fetchShippingMethods,
fetchStatusInformation
fetchStatusInformation,
getCarrierInformation,
getCarrierDeliveryDays
}

0 comments on commit 1b85b67

Please sign in to comment.