mirror of
https://github.com/smittix/intercept.git
synced 2026-07-12 11:38:12 -07:00
Fix known devices API: send 'protocol' instead of 'device_type'
The endpoint expects 'protocol' field but JS was sending 'device_type' Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9274,7 +9274,7 @@
|
|||||||
if (!identifier) return;
|
if (!identifier) return;
|
||||||
|
|
||||||
const name = prompt('Enter friendly name for this device:');
|
const name = prompt('Enter friendly name for this device:');
|
||||||
const deviceType = prompt('Enter device type (wifi/bluetooth/rf):') || 'wifi';
|
const protocol = prompt('Enter protocol type (wifi/bluetooth/rf):') || 'wifi';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/tscm/known-devices', {
|
const response = await fetch('/tscm/known-devices', {
|
||||||
@@ -9282,8 +9282,8 @@
|
|||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
identifier: identifier,
|
identifier: identifier,
|
||||||
name: name || identifier,
|
protocol: protocol,
|
||||||
device_type: deviceType
|
name: name || identifier
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -9318,7 +9318,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function tscmAddToKnownDevices(identifier, name, deviceType) {
|
async function tscmAddToKnownDevices(identifier, name, protocol) {
|
||||||
// Ask for optional custom name
|
// Ask for optional custom name
|
||||||
const customName = prompt(`Add "${name}" to known devices.\n\nEnter a friendly name (or leave blank to use default):`, name);
|
const customName = prompt(`Add "${name}" to known devices.\n\nEnter a friendly name (or leave blank to use default):`, name);
|
||||||
if (customName === null) return; // User cancelled
|
if (customName === null) return; // User cancelled
|
||||||
@@ -9329,8 +9329,8 @@
|
|||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
identifier: identifier,
|
identifier: identifier,
|
||||||
name: customName || name,
|
protocol: protocol,
|
||||||
device_type: deviceType
|
name: customName || name
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user