mirror of
https://github.com/foss42/apidash.git
synced 2025-06-01 23:45:19 +08:00
Users can now choose whether or not to save response results
This commit is contained in:
@ -188,10 +188,15 @@ class CollectionStateNotifier extends StateNotifier<List<RequestModel>?> {
|
||||
}
|
||||
|
||||
Future<void> saveData() async {
|
||||
final saveResponse =
|
||||
ref.read(settingsProvider.select((value) => value.saveResponses));
|
||||
final ids = getIds();
|
||||
await hiveHandler.setIds(ids);
|
||||
for (var e in state!) {
|
||||
await hiveHandler.setRequestModel(e.id, e.toJson());
|
||||
await hiveHandler.setRequestModel(
|
||||
e.id,
|
||||
e.toJson(includeResponse: saveResponse),
|
||||
);
|
||||
}
|
||||
await hiveHandler.removeUnused();
|
||||
}
|
||||
|
Reference in New Issue
Block a user