mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 08:16:51 -04:00
add comments
This commit is contained in:
@@ -189,9 +189,12 @@
|
|||||||
var daily_stats_by_user = activityChartContainer.getAttribute('data-daily_stats_by_user');
|
var daily_stats_by_user = activityChartContainer.getAttribute('data-daily_stats_by_user');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var serializedStats = type === 'service' ? daily_stats : daily_stats_by_user;
|
// Choose the correct JSON string based on the type ('service' or 'user'),
|
||||||
serializedStats = serializedStats.replace(/'/g, '"');
|
// replace single quotes with double quotes to ensure valid JSON format,
|
||||||
data = JSON.parse(serializedStats);
|
// then parse the JSON string into a JavaScript object.
|
||||||
|
var statJson = type === 'service' ? daily_stats : daily_stats_by_user;
|
||||||
|
statJson = statJson.replace(/'/g, '"');
|
||||||
|
data = JSON.parse(statJson);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error parsing JSON data:', error);
|
console.error('Error parsing JSON data:', error);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user