aboutsummaryrefslogtreecommitdiff
path: root/modern/src/CommandsPage.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/CommandsPage.js')
-rw-r--r--modern/src/CommandsPage.js7
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) {