|
|
|
|
@ -1,5 +1,4 @@
|
|
|
|
|
|
|
|
|
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
|
|
|
|
// import 'package:cloud_firestore/cloud_firestore.dart';
|
|
|
|
|
|
|
|
|
|
List<String> monitoredEndpoints = [
|
|
|
|
|
"Services/Sentry.svc/REST/MemberLogIN_New",
|
|
|
|
|
@ -37,7 +36,6 @@ void postFailureResponse({
|
|
|
|
|
// await collectionRef.doc(DateTime.now().toIso8601String()).set(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void postRequestAndResponse({
|
|
|
|
|
required dynamic doctorId,
|
|
|
|
|
required String completeUrl,
|
|
|
|
|
@ -46,21 +44,21 @@ void postRequestAndResponse({
|
|
|
|
|
required String response,
|
|
|
|
|
required String statusCode,
|
|
|
|
|
}) async {
|
|
|
|
|
if(!monitoredEndpoints.contains(urlSuffix)) {
|
|
|
|
|
if (!monitoredEndpoints.contains(urlSuffix)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
print(" the url is being logged ");
|
|
|
|
|
Map<String, String> data = {
|
|
|
|
|
"url" : completeUrl,
|
|
|
|
|
"request" : request,
|
|
|
|
|
"response" : response,
|
|
|
|
|
"statusCode" : statusCode,
|
|
|
|
|
"url": completeUrl,
|
|
|
|
|
"request": request,
|
|
|
|
|
"response": response,
|
|
|
|
|
"statusCode": statusCode,
|
|
|
|
|
};
|
|
|
|
|
final firestore = FirebaseFirestore.instance;
|
|
|
|
|
// final firestore = FirebaseFirestore.instance;
|
|
|
|
|
// Sanitize urlSuffix to be Firestore-safe
|
|
|
|
|
final safeSuffix = urlSuffix.replaceAll(RegExp(r'[^a-zA-Z0-9_-]'), '_');
|
|
|
|
|
final collectionRef = firestore.collection('doctors')
|
|
|
|
|
.doc(doctorId.toString())
|
|
|
|
|
.collection(safeSuffix);
|
|
|
|
|
await collectionRef.doc(DateTime.now().toIso8601String()).set(data);
|
|
|
|
|
}
|
|
|
|
|
// final collectionRef = firestore.collection('doctors')
|
|
|
|
|
// .doc(doctorId.toString())
|
|
|
|
|
// .collection(safeSuffix);
|
|
|
|
|
// await collectionRef.doc(DateTime.now().toIso8601String()).set(data);
|
|
|
|
|
}
|
|
|
|
|
|