Files

156 lines
3.9 KiB
JavaScript

const URL = "/one-api/mockup/purchase/receivesuratjalan/ReceiveSuratJalan/";
export async function lookupEkpedisi(params) {
try {
var response = await axios.post(URL + 'LookupEkspedisi', params)
if (response.status !== 200) {
return {
status: "ERR",
message: response.statusText
}
}
let data = response.data
return data
} catch (error) {
return {
status: "ERR",
message: error.message
}
}
}
export async function lookupEkspedisiStaff(params) {
try {
var response = await axios.post(URL + 'LookupEkspedisiStaff', params)
if (response.status !== 200) {
return {
status: "ERR",
message: response.statusText
}
}
let data = response.data
return data
} catch (error) {
return {
status: "ERR",
message: error.message
}
}
}
export async function listingBranch(params) {
try {
var response = await axios.post(URL + 'ListingBranch', params)
if (response.status !== 200) {
return {
status: "ERR",
message: response.statusText
}
}
let data = response.data
return data
} catch (error) {
return {
status: "ERR",
message: error.message
}
}
}
export async function lookupWarehouse(params) {
try {
var response = await axios.post(URL + 'LookupWarehouse', params)
if (response.status !== 200) {
return {
status: "ERR",
message: response.statusText
}
}
let data = response.data
return data
} catch (error) {
return {
status: "ERR",
message: error.message
}
}
}
export async function lookupDetailSuratJalan(params) {
try {
var response = await axios.post(URL + 'LookupDetailSuratJalan', params)
if (response.status !== 200) {
return {
status: "ERR",
message: response.statusText
}
}
let data = response.data
return data
} catch (error) {
return {
status: "ERR",
message: error.message
}
}
}
export async function lookupSuratJalan(params) {
try {
var response = await axios.post(URL + 'LookupSuratJalan', params)
if (response.status !== 200) {
return {
status: "ERR",
message: response.statusText
}
}
let data = response.data
return data
} catch (error) {
return {
status: "ERR",
message: error.message
}
}
}
export async function saveReciveSJ(params) {
try {
var response = await axios.post(URL + 'SaveReceiveSJ', params)
if (response.status !== 200) {
return {
status: "ERR",
message: response.statusText
}
}
let data = response.data
return data
} catch (error) {
return {
status: "ERR",
message: error.message
}
}
}
// test input
export async function testinput(params) {
try {
var response = await axios.post(URL + 'TestInput', params)
if (response.status !== 200) {
return {
status: "ERR",
message: response.statusText
}
}
let data = response.data
return data
} catch (error) {
return {
status: "ERR",
message: error.message
}
}
}