add comments

This commit is contained in:
Beverly Nguyen
2024-08-12 11:51:20 -07:00
parent 96d6415578
commit a0e177b99b

View File

@@ -192,9 +192,9 @@
// Choose the correct JSON string based on the type ('service' or 'user'), // Choose the correct JSON string based on the type ('service' or 'user'),
// replace single quotes with double quotes to ensure valid JSON format, // replace single quotes with double quotes to ensure valid JSON format,
// then parse the JSON string into a JavaScript object. // then parse the JSON string into a JavaScript object.
var statJson = type === 'service' ? daily_stats : daily_stats_by_user; var statsJson = type === 'service' ? daily_stats : daily_stats_by_user;
statJson = statJson.replace(/'/g, '"'); statsJson = statsJson.replace(/'/g, '"');
data = JSON.parse(statJson); data = JSON.parse(statsJson);
} catch (error) { } catch (error) {
console.error('Error parsing JSON data:', error); console.error('Error parsing JSON data:', error);
return; return;