fix: perbaiki endpoint kontrol exhaust fan - Ubah endpoint dari /sensor/exhaust ke /sensor/control - Tambah mode MANUAL dan field fanExhaust - Exhaust fan sekarang bisa dikontrol dengan benar

This commit is contained in:
flemss 2026-06-15 03:29:46 +07:00
parent b16e270e79
commit 3448854cde
1 changed files with 3 additions and 3 deletions

View File

@ -251,14 +251,14 @@ export default function ControlPanel() {
const newState = !isExhaustOn const newState = !isExhaustOn
try { try {
// Endpoint untuk exhaust bisa disesuaikan dengan backend const response = await fetch(`${API_URL}/sensor/control`, {
const response = await fetch(`${API_URL}/sensor/exhaust`, {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
body: JSON.stringify({ body: JSON.stringify({
exhaust: newState mode: 'MANUAL',
fanExhaust: newState
}) })
}) })