Browse Source

Add formatting

pull/1/head
Wahyu Ramadhan 1 year ago
parent
commit
49b517b74d
  1. 32
      edit-mode/function/reportActivity.js

32
edit-mode/function/reportActivity.js

@ -426,23 +426,23 @@ $(document).ready(function () {
const reportId = result.data.data.report_id;
try {
const image = formData.get("files");
const imageFormData = new FormData();
imageFormData.append("ref_id", reportId);
imageFormData.append("category", "report_activity");
imageFormData.append("files", image, image.name);
if (image.name && image.size) {
const resultImage = await axiosInstanceMultipart.post(`${base_url}image/upload`, imageFormData);
}
const image = formData.get("files");
const imageFormData = new FormData();
imageFormData.append("ref_id", reportId);
imageFormData.append("category", "report_activity");
imageFormData.append("files", image, image.name);
if (image.name && image.size) {
const resultImage = await axiosInstanceMultipart.post(`${base_url}image/upload`, imageFormData);
}
if (result.status === 200) {
gantt.alert("Add report activity material Success!");
resetFormAddRaMaterial();
tableRaMaterialActual.draw();
} else {
throw new Error("Add report activity material failed.");
}
if (result.status === 200) {
gantt.alert("Add report activity material Success!");
resetFormAddRaMaterial();
tableRaMaterialActual.draw();
} else {
throw new Error("Add report activity material failed.");
}
} catch (error) {
throw new Error("Image upload failed.");
}

Loading…
Cancel
Save