API & UI Admin Menu Keamanan Done

This commit is contained in:
2025-07-03 16:09:39 +08:00
parent 10361770b4
commit b92a974dcd
15 changed files with 779 additions and 178 deletions

View File

@@ -179,17 +179,20 @@ const keamananLingkunganState = proxy({
try {
keamananLingkunganState.edit.loading = true;
const response = await fetch(`/api/keamanan/keamananlingkungan/${this.id}`, {
method: "PUT",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
name: this.form.name,
deskripsi: this.form.deskripsi,
imageId: this.form.imageId,
}),
});
const response = await fetch(
`/api/keamanan/keamananlingkungan/${this.id}`,
{
method: "PUT",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
name: this.form.name,
deskripsi: this.form.deskripsi,
imageId: this.form.imageId,
}),
}
);
if (!response.ok) {
const errorData = await response.json().catch(() => ({}));