upd: menerapkan log pada semua aksi
This commit is contained in:
@@ -196,6 +196,12 @@ function VillageDetailPage() {
|
||||
})
|
||||
|
||||
if (res.ok) {
|
||||
await fetch(API_URLS.createLog(), {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ type: 'UPDATE', message: `Data desa (${appId}) diperbarui: ${editForm.name}-${village.id}` })
|
||||
}).catch(console.error)
|
||||
|
||||
notifications.show({
|
||||
title: 'Success',
|
||||
message: 'Village data has been updated successfully.',
|
||||
@@ -238,6 +244,12 @@ function VillageDetailPage() {
|
||||
})
|
||||
|
||||
if (res.ok) {
|
||||
await fetch(API_URLS.createLog(), {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ type: 'UPDATE', message: `Status desa (${appId}) diperbarui (${!village.isActive ? 'activated' : 'deactivated'}): ${village.name}-${village.id}` })
|
||||
}).catch(console.error)
|
||||
|
||||
notifications.show({
|
||||
title: 'Success',
|
||||
message: `Village status has been ${!village.isActive ? 'activated' : 'deactivated'}.`,
|
||||
@@ -477,9 +489,9 @@ function VillageDetailPage() {
|
||||
<Button variant="light" color="gray" onClick={closeConfirmModal} radius="md">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
color={village.isActive ? 'red' : 'green'}
|
||||
onClick={handleConfirmToggle}
|
||||
<Button
|
||||
color={village.isActive ? 'red' : 'green'}
|
||||
onClick={handleConfirmToggle}
|
||||
loading={isUpdating}
|
||||
radius="md"
|
||||
>
|
||||
@@ -488,7 +500,7 @@ function VillageDetailPage() {
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
|
||||
|
||||
{/* ── Edit Village Modal ── */}
|
||||
<Modal
|
||||
opened={editModalOpened}
|
||||
|
||||
Reference in New Issue
Block a user