first commit

This commit is contained in:
2024-08-01 17:02:23 +07:00
commit 1eb8be275b
6 changed files with 1616 additions and 0 deletions

View File

@@ -0,0 +1,81 @@
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,
};
}
}