diff options
author | Iván Ávalos <avalos@disroot.org> | 2023-01-03 19:28:13 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2023-01-03 19:28:13 -0600 |
commit | dc126a515783a2998aa40e7bee66b4f9846c9fe8 (patch) | |
tree | 9f168261bd104ccdd08b106528eb7907c880f630 /modern/src/CommandsPage.js | |
parent | 3240d452cbcdf9553e47d5a95604e5c7e92924cd (diff) | |
download | etbsa-traccar-web-dc126a515783a2998aa40e7bee66b4f9846c9fe8.tar.gz etbsa-traccar-web-dc126a515783a2998aa40e7bee66b4f9846c9fe8.tar.bz2 etbsa-traccar-web-dc126a515783a2998aa40e7bee66b4f9846c9fe8.zip |
Se arreglan comandos y se cambia cálculo de status
Diffstat (limited to 'modern/src/CommandsPage.js')
-rw-r--r-- | modern/src/CommandsPage.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/modern/src/CommandsPage.js b/modern/src/CommandsPage.js index 1458b43..3680a0d 100644 --- a/modern/src/CommandsPage.js +++ b/modern/src/CommandsPage.js @@ -66,13 +66,12 @@ const CommandsPage = () => { }, [id]); const handleSend = async () => { + const cmd = commands.find(c => c.id.toString() == selectedCommand); + cmd.deviceId = device.id; const response = await fetch(`/api/commands/send`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ - 'id': selectedCommand, - 'deviceId': device.id, - }), + body: JSON.stringify(cmd), }); if (response.ok) { |