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

129 lines
3.2 KiB
JavaScript

const URL = "/one-api/mockup/sendemailv2/"
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
};
}
}
export async function searchproject(prm) {
try {
var resp = await axios.post(URL + 'sendemail/searchproject', 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
};
}
}