diff --git a/frontend/api/routes/docs.js b/frontend/api/routes/docs.js
index 58bc5458..025d847b 100644
--- a/frontend/api/routes/docs.js
+++ b/frontend/api/routes/docs.js
@@ -22,6 +22,18 @@ router.post('/', (req, res) => {
res.json(doc)
})
+// Upload a file.
+router.post('/upload', (req, res) => {
+ const doc = {
+ id: db.reduce((x, y) => { return x.id > y.id ? x : y }).id + 1,
+ text: 'Uploaded Document',
+ meta: JSON.stringify({}),
+ annotations: []
+ }
+ db.push(doc)
+ res.json(doc)
+})
+
// Update a document partially.
router.patch('/:docId', (req, res) => {
const docIndex = db.findIndex(item => item.id === parseInt(req.params.docId))
diff --git a/frontend/components/containers/DocumentUploadButton.vue b/frontend/components/containers/DocumentUploadButton.vue
index bccfc54b..6ce15a20 100644
--- a/frontend/components/containers/DocumentUploadButton.vue
+++ b/frontend/components/containers/DocumentUploadButton.vue
@@ -7,9 +7,6 @@
@@ -28,11 +25,11 @@ export default {
},
computed: {
- ...mapGetters('documents', ['formatList', 'parsedDoc', 'headers'])
+ ...mapGetters('documents', ['formatList'])
},
methods: {
- ...mapActions('documents', ['uploadDocument', 'parseFile'])
+ ...mapActions('documents', ['uploadDocument'])
}
}
diff --git a/frontend/components/organisms/DocumentUploadForm.vue b/frontend/components/organisms/DocumentUploadForm.vue
index 548b6a59..62362a0a 100644
--- a/frontend/components/organisms/DocumentUploadForm.vue
+++ b/frontend/components/organisms/DocumentUploadForm.vue
@@ -28,28 +28,19 @@
:accept="acceptType"
:rules="uploadFileRules"
label="File input"
- @change="parseFile"
/>
-