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:
parent
b16e270e79
commit
3448854cde
|
|
@ -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
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue