mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-19 05:53:51 -04:00
Updated frontend call to include local timezone
This commit is contained in:
@@ -201,15 +201,22 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var url = type === 'service' ? `/daily_stats.json` : `/daily_stats_by_user.json`;
|
||||
// get local timezone
|
||||
var userTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
var url = type === 'service'
|
||||
? `/daily_stats.json?timezone=${encodeURIComponent(userTimezone)}`
|
||||
: `/daily_stats_by_user.json`;
|
||||
|
||||
return fetch(url)
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
console.log(response)
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
console.log(data)
|
||||
labels = [];
|
||||
deliveredData = [];
|
||||
failedData = [];
|
||||
|
||||
Reference in New Issue
Block a user