upd: tambah notifikasi success/error saat simpan Settings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-29 15:54:38 +08:00
parent d17b49cf8f
commit 5050835d81

View File

@@ -70,6 +70,7 @@ import {
TbUserSearch,
TbUsers,
} from 'react-icons/tb'
import { notifications } from '@mantine/notifications'
import { type Role, useLogout, useSession } from '@/frontend/hooks/useAuth'
import { usePresence } from '@/frontend/hooks/usePresence'
@@ -1517,6 +1518,10 @@ function SettingsPanel() {
qc.invalidateQueries({ queryKey: ['admin', 'config'] })
setSaved(true)
setTimeout(() => setSaved(false), 2000)
notifications.show({ color: 'green', title: 'Tersimpan', message: 'Konfigurasi berhasil disimpan.' })
},
onError: () => {
notifications.show({ color: 'red', title: 'Gagal', message: 'Terjadi kesalahan saat menyimpan konfigurasi.' })
},
})