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

110 lines
2.7 KiB
JavaScript

const URL = "/one-api/mockup/sendemail/"
export async function getsetup(token) {
try {
var resp = await axios.post(URL + 'sendemail/getsetup', { token: token });
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(prm) {
try {
var resp = await axios.post(URL + 'sendemail/search', 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 getdetail(prm) {
try {
var resp = await axios.post(URL + 'sendemail/getdetail', 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 savehandover(prm) {
try {
var resp = await axios.post(URL + 'sendemail/saveHandover', 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 sendemail(prm) {
try {
var resp = await axios.post(URL + 'sendemail/sendEmail', 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 deletehandoverdetail(prm) {
try {
var resp = await axios.post(URL + 'sendemail/deletehandoverdetail', 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
};
}
}