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/file | |
| 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/file')
| -rw-r--r-- | src/site/pages/dashboard/admin/file/_id.vue | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/site/pages/dashboard/admin/file/_id.vue b/src/site/pages/dashboard/admin/file/_id.vue index 135d066..2d7607f 100644 --- a/src/site/pages/dashboard/admin/file/_id.vue +++ b/src/site/pages/dashboard/admin/file/_id.vue @@ -129,15 +129,11 @@ export default { components: { Sidebar }, - middleware: ['auth', 'admin', ({ route, store }) => { - try { - store.dispatch('admin/fetchFile', route.params.id); - } catch (e) { - // eslint-disable-next-line no-console - console.error(e); - } - }], + middleware: ['auth', 'admin'], computed: mapState(['admin', 'auth']), + async asyncData({ app, params }) { + await app.store.dispatch('admin/fetchFile', params.id); + }, methods: { promptDisableUser() { this.$buefy.dialog.confirm({ |