From ea3e503d13b7be477c064b02b9b2e5a9ef06c9a9 Mon Sep 17 00:00:00 2001
From: Pitu <heyitspitu@gmail.com>
Date: Fri, 29 Mar 2019 00:35:58 +0900
Subject: Added middleware for pages and switched to $axios

---
 src/site/pages/a/_identifier.vue | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

(limited to 'src/site/pages/a/_identifier.vue')

diff --git a/src/site/pages/a/_identifier.vue b/src/site/pages/a/_identifier.vue
index a1f719a..d00ad85 100644
--- a/src/site/pages/a/_identifier.vue
+++ b/src/site/pages/a/_identifier.vue
@@ -51,19 +51,26 @@
 
 <script>
 import Grid from '~/components/grid/Grid.vue';
-import Loading from '~/components/loading/CubeShadow.vue';
 import axios from 'axios';
 
 export default {
-	components: { Grid, Loading },
+	components: { Grid },
+	data() {
+		return {};
+	},
+	computed: {
+		config() {
+			return this.$store.state.config;
+		}
+	},
 	async asyncData({ app, params, error }) {
 		try {
-			const res = await axios.get(`${app.store.state.config.baseURL}/album/${params.identifier}`);
-			const downloadLink = res.data.downloadEnabled ? `${app.store.state.config.baseURL}/album/${params.identifier}/zip` : null;
+			const data = await axios.get(`${app.store.state.config.baseURL}/album/${params.identifier}`);
+			const downloadLink = data.downloadEnabled ? `${app.store.state.config.baseURL}/album/${params.identifier}/zip` : null;
 			return {
-				name: res.data.name,
-				downloadEnabled: res.data.downloadEnabled,
-				files: res.data.files,
+				name: data.name,
+				downloadEnabled: data.downloadEnabled,
+				files: data.files,
 				downloadLink
 			};
 		} catch (err) {
@@ -79,14 +86,6 @@ export default {
 			error({ statusCode: 404, message: 'Post not found' });
 		}
 	},
-	data() {
-		return {};
-	},
-	computed: {
-		config() {
-			return this.$store.state.config;
-		}
-	},
 	metaInfo() {
 		if (this.files) {
 			return {
-- 
cgit v1.2.3

