aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/components/BaseCommandView.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/settings/components/BaseCommandView.js')
-rw-r--r--modern/src/settings/components/BaseCommandView.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/modern/src/settings/components/BaseCommandView.js b/modern/src/settings/components/BaseCommandView.js
index ca81a854..1ba6a37c 100644
--- a/modern/src/settings/components/BaseCommandView.js
+++ b/modern/src/settings/components/BaseCommandView.js
@@ -7,7 +7,7 @@ import SelectField from '../../common/components/SelectField';
import { prefixString } from '../../common/util/stringUtils';
import useCommandAttributes from '../../common/attributes/useCommandAttributes';
-const BaseCommandView = ({ item, setItem }) => {
+const BaseCommandView = ({ deviceId, item, setItem }) => {
const t = useTranslation();
const availableAttributes = useCommandAttributes(t);
@@ -27,7 +27,7 @@ const BaseCommandView = ({ item, setItem }) => {
<SelectField
value={item.type || ''}
onChange={(e) => setItem({ ...item, type: e.target.value, attributes: {} })}
- endpoint="/api/commands/types"
+ endpoint={deviceId ? `/api/commands/types?${new URLSearchParams({ deviceId }).toString()}` : '/api/commands/types'}
keyGetter={(it) => it.type}
titleGetter={(it) => t(prefixString('command', it.type))}
label={t('sharedType')}