wip: history request groups

This commit is contained in:
DenserMeerkat
2024-07-14 23:16:29 +05:30
parent 78c5fc6a94
commit d5feb0b091
31 changed files with 1284 additions and 71 deletions

View File

@ -240,12 +240,28 @@ class CollectionStateNotifier
httpResponseModel: responseModel,
isWorking: false,
);
String newHistoryId = getNewUuid();
HistoryRequestModel model = HistoryRequestModel(
historyId: newHistoryId,
metaData: HistoryMetaModel(
historyId: newHistoryId,
name: requestModel.name,
url: substitutedHttpRequestModel.url,
method: substitutedHttpRequestModel.method,
responseStatus: statusCode,
timeStamp: DateTime.now(),
),
httpRequestModel: substitutedHttpRequestModel,
httpResponseModel: responseModel,
);
ref.read(historyMetaStateNotifier.notifier).addHistoryRequest(model);
}
// update state with response data
map = {...state!};
map[id] = newRequestModel;
state = map;
ref.read(hasUnsavedChangesProvider.notifier).state = true;
}