There was a bug where the frontend was not passing the organization id to the backend, and thus the fetching of the stats failed for organization articles. This also adds a bit of error handling for `fetch` API
13 lines
339 B
JavaScript
13 lines
339 B
JavaScript
import initCharts from '../analytics/dashboard';
|
|
|
|
function initDashboardArticle() {
|
|
const article = document.getElementById('article');
|
|
const { articleId, organizationId } = article.dataset;
|
|
initCharts({ articleId, organizationId });
|
|
}
|
|
|
|
window.InstantClick.on('change', () => {
|
|
initDashboardArticle();
|
|
});
|
|
|
|
initDashboardArticle();
|