first commit
This commit is contained in:
81
one-new-ticket-support-v3/api/ticket.js
Normal file
81
one-new-ticket-support-v3/api/ticket.js
Normal 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,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user