82 lines
1.6 KiB
JavaScript
82 lines
1.6 KiB
JavaScript
const URL = "/one-api-support/support/ticketing_v3/";
|
|
|
|
export async function search_branch(search, client_id) {
|
|
try {
|
|
var resp = await axios.post(URL + "search_branch", {
|
|
search: search,
|
|
client_id: client_id,
|
|
});
|
|
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 search_client(search, client_id) {
|
|
try {
|
|
var resp = await axios.post(URL + "search_client", {
|
|
search: search,
|
|
});
|
|
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 new_ticket(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + "new_ticket", 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 uploadimage(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + "uploadimage", 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,
|
|
};
|
|
}
|
|
}
|