diff options
| author | Pitu <[email protected]> | 2021-01-20 14:09:06 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2021-01-20 14:09:06 +0900 |
| commit | a3bf693d30d3c1c1d9e4073830522554c3f1c4e8 (patch) | |
| tree | c1902391d0eb2f059030c2c41a08f91422d80eed /src/site/pages/dashboard/admin/statistics.vue | |
| parent | feat: enable ssr and serve it with the api (diff) | |
| download | host.fuwn.me-a3bf693d30d3c1c1d9e4073830522554c3f1c4e8.tar.xz host.fuwn.me-a3bf693d30d3c1c1d9e4073830522554c3f1c4e8.zip | |
chore: switch to asyncData where needed
Diffstat (limited to 'src/site/pages/dashboard/admin/statistics.vue')
| -rw-r--r-- | src/site/pages/dashboard/admin/statistics.vue | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/site/pages/dashboard/admin/statistics.vue b/src/site/pages/dashboard/admin/statistics.vue index c1e79fc..1b951fc 100644 --- a/src/site/pages/dashboard/admin/statistics.vue +++ b/src/site/pages/dashboard/admin/statistics.vue @@ -78,16 +78,13 @@ export default { detailed, generic }, - middleware: ['auth', 'admin', ({ store }) => { - try { - store.dispatch('admin/fetchStatistics'); - } catch (e) { - console.error(e); - } - }], + middleware: ['auth', 'admin'], computed: mapState({ stats: state => state.admin.statistics }), + async asyncData({ app }) { + await app.store.dispatch('admin/fetchStatistics'); + }, methods: { refresh(category) { try { |