mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Add edit dialog for registered devices
Extend PUT /api/devices/{mac} to accept an optional name and surface an
Edit action from both the device detail screen and the per-row overflow
menu, letting users modify owner, device type, vendor and name without
forgetting and re-registering.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
3a579f0321
commit
0f6296759d
@@ -150,6 +150,25 @@ class BackendAPI {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> updateDevice(
|
||||
String macAddress,
|
||||
String owner,
|
||||
String deviceType,
|
||||
String vendor, {
|
||||
String? name,
|
||||
}) async {
|
||||
debugPrint('About to call PUT /devices/$macAddress');
|
||||
await _dio.put(
|
||||
'/devices/$macAddress',
|
||||
data: {
|
||||
'owner': owner,
|
||||
'device_type': deviceType,
|
||||
'vendor': vendor,
|
||||
'name': name,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> forgetDevice(String macAddress) async {
|
||||
debugPrint('About to call DELETE /devices/$macAddress');
|
||||
await _dio.delete('/devices/$macAddress');
|
||||
|
||||
Reference in New Issue
Block a user