forked from hotwax/order-routing
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented: service to fetch orders and service to broker order(hotw…
- Loading branch information
1 parent
f8a1608
commit f819a5b
Showing
3 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { client } from "@/api"; | ||
import store from "@/store"; | ||
|
||
const fetchProducts = 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: "searchProducts", | ||
method: "post", | ||
baseURL: baseURL, | ||
data: payload, | ||
headers: { | ||
Authorization: 'Bearer ' + omsRedirectionInfo.token, | ||
'Content-Type': 'application/json' | ||
} | ||
}); | ||
} | ||
|
||
const getInventoryAvailableByFacility = 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: "service/getInventoryAvailableByFacility", | ||
method: "post", | ||
baseURL: baseURL, | ||
data: payload, | ||
headers: { | ||
Authorization: 'Bearer ' + omsRedirectionInfo.token, | ||
'Content-Type': 'application/json' | ||
} | ||
}); | ||
} | ||
|
||
export const ProductService = { | ||
fetchProducts, | ||
getInventoryAvailableByFacility | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters