UI & API Admin Kesehatan Done

This commit is contained in:
2025-06-20 08:11:31 +08:00
parent 4a5524ce88
commit fc08b2e790
19 changed files with 1209 additions and 423 deletions

View File

@@ -30,6 +30,9 @@ const infoWabahPenyakitDelete = async (context: Context) => {
try {
const filePath = path.join(infoWabahPenyakit.image.path, infoWabahPenyakit.image.name);
await fs.unlink(filePath);
await prisma.fileStorage.delete({
where: { id: infoWabahPenyakit.image.id },
});
} catch (err) {
console.error("Gagal hapus gambar:", err);
}
@@ -41,7 +44,8 @@ const infoWabahPenyakitDelete = async (context: Context) => {
return {
status: 200,
body: "Info wabah penyakit berhasil dihapus",
success: true,
message: "Penanganan darurat dan file terkait berhasil dihapus",
};
};
export default infoWabahPenyakitDelete;