From 4b2b02110b457d8ebeee78e1bdf99eb0660d0626 Mon Sep 17 00:00:00 2001 From: Pitu <7425261+Pitu@users.noreply.github.com> Date: Tue, 18 Sep 2018 03:34:00 -0300 Subject: We can now download albums yayyyy --- src/site/views/PublicAlbum.vue | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/site') diff --git a/src/site/views/PublicAlbum.vue b/src/site/views/PublicAlbum.vue index 534c185..e156698 100644 --- a/src/site/views/PublicAlbum.vue +++ b/src/site/views/PublicAlbum.vue @@ -24,6 +24,8 @@

{{ name }}

Serving {{ files.length }} files

+ Download Album
@@ -57,17 +59,20 @@ export default { async getInitialData({ route, store }) { try { const res = await axios.get(`${config.baseURL}/album/${route.params.identifier}`); + const downloadLink = res.data.downloadEnabled ? `${config.baseURL}/album/${route.params.identifier}/zip` : null; return { name: res.data.name, downloadEnabled: res.data.downloadEnabled, - files: res.data.files + files: res.data.files, + downloadLink }; } catch (error) { console.error(error); return { name: null, downloadEnabled: false, - files: [] + files: [], + downloadLink: null }; } }, @@ -100,6 +105,11 @@ export default { location: window.location.href }); }, - methods: {} + methods: { + async downloadAlbum() { + const response = await axios.get(`${config.baseURL}/album/${this.$route.params.identifier}/zip`); + console.log(response.data); + } + } }; -- cgit v1.2.3