mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Refactor FactoryResetModel and MainDoorSensorBatchView
- Refactor FactoryResetModel to include 'operationType' in toJson and toMap methods. - Refactor MainDoorSensorBatchView to use BlocProvider and Builder for better state management.
This commit is contained in:
@ -321,13 +321,14 @@ class DevicesManagementApi {
|
||||
Future<bool> factoryReset(FactoryResetModel factoryReset, String uuid) async {
|
||||
try {
|
||||
final response = await HTTPService().post(
|
||||
path: ApiEndpoints.factoryReset.replaceAll('{deviceUuid}', uuid),
|
||||
path: ApiEndpoints.factoryReset,
|
||||
body: factoryReset.toMap(),
|
||||
showServerMessage: true,
|
||||
expectedResponseModel: (json) {
|
||||
return json['success'] ?? false;
|
||||
},
|
||||
);
|
||||
|
||||
return response;
|
||||
} catch (e) {
|
||||
debugPrint('Error fetching $e');
|
||||
|
Reference in New Issue
Block a user