This commit is contained in:
Viet An
2026-06-10 13:46:11 +07:00
parent 7025fd8cd5
commit 22c284f1ef
15 changed files with 31 additions and 268 deletions

View File

@@ -198,15 +198,17 @@ const handleSave = async () => {
};
const handleCreateNew = async () => {
const postTemplateUrl = `${apiUrl}/Email_Template/`;
try {
loadingCreate.value = true;
const newTemplateData = {
...props.data,
name: templateName.value,
};
const response = await axios.post(postTemplateUrl, newTemplateData);
if (response.status === 201 || response.status === 200) {
const res = await $insertapi("Email_Template", {
data: newTemplateData,
notify: false,
});
if (res !== "error") {
$snackbar("Template created successfully");
if (props.onClose) props.onClose();
emit("close");