From 25c6877123bd4e4cea53e4cadca8845f93ef3161 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Wed, 18 Sep 2019 13:44:44 +0900 Subject: [PATCH] Implement download feature roughly --- frontend/api/routes/docs.js | 5 +++++ .../pages/projects/_id/download/index.vue | 21 +++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/frontend/api/routes/docs.js b/frontend/api/routes/docs.js index 025d847b..999c9c09 100644 --- a/frontend/api/routes/docs.js +++ b/frontend/api/routes/docs.js @@ -34,6 +34,11 @@ router.post('/upload', (req, res) => { res.json(doc) }) +// Download a file. +router.get('/download', (req, res) => { + res.json(db) +}) + // Update a document partially. router.patch('/:docId', (req, res) => { const docIndex = db.findIndex(item => item.id === parseInt(req.params.docId)) diff --git a/frontend/pages/projects/_id/download/index.vue b/frontend/pages/projects/_id/download/index.vue index 5c529460..5bed2f13 100644 --- a/frontend/pages/projects/_id/download/index.vue +++ b/frontend/pages/projects/_id/download/index.vue @@ -1,9 +1,26 @@