Files
FE_CPONE/test/vuex/cpone-queue-ticket/api/queue.js
2026-04-27 10:13:31 +07:00

110 lines
2.8 KiB
JavaScript

const URL = "/one-api/mockup/fo/antrian/";
export async function getStation() {
try {
var resp = await axios.post(URL + 'AntrianByStationAndLocation/getStation', {});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getbranch() {
try {
var resp = await axios.post(URL + 'AntrianByStationAndLocation/getbranch', {});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getAntrian(prm) {
try {
var resp = await axios.post(URL + 'AntrianByStationAndLocation/getAntrianV2', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getSetup(branchID) {
try {
var resp = await axios.post(URL + 'AntrianByStationAndLocation/getsetup/' + branchID);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getsetuponsite() {
try {
var resp = await axios.post(URL + 'AntrianByStationAndLocation/getsetuponsite');
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getTicket(code) {
try {
var resp = await axios.post(URL + 'AntrianByStationAndLocation/getTicket/' + code);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}