diff options
Diffstat (limited to 'modern/src/CommandsPage.js')
-rw-r--r-- | modern/src/CommandsPage.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modern/src/CommandsPage.js b/modern/src/CommandsPage.js index e36c365..1458b43 100644 --- a/modern/src/CommandsPage.js +++ b/modern/src/CommandsPage.js @@ -66,18 +66,19 @@ const CommandsPage = () => { }, [id]); const handleSend = async () => { - console.log ('Selected: ' + selectedCommand); const response = await fetch(`/api/commands/send`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ - id: selectedCommand.id, - deviceId: device.id, + 'id': selectedCommand, + 'deviceId': device.id, }), }); if (response.ok) { history.goBack(); + } else { + console.log ('response!', response); } }; @@ -90,6 +91,7 @@ const CommandsPage = () => { <> <CardContent> <Typography gutterBottom variant="h5">{t('commandSend')}</Typography> + <Typography variant="body2" color="text.secondary">{device.name}</Typography> {commands && ( <FormControl fullWidth aria-label="command"> <RadioGroup onChange={(event) => setSelectedCommand(event.target.value) }> |