Flatten nested repos
This commit is contained in:
110
test/vuex/cpone-queue-ticket/api/queue.js
Normal file
110
test/vuex/cpone-queue-ticket/api/queue.js
Normal file
@@ -0,0 +1,110 @@
|
||||
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
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user