From 903090ef44b83b5feebce0338d5c6070eaa869d9 Mon Sep 17 00:00:00 2001 From: Kirill Stytsenko <kirill@styts.com> Date: Tue, 30 Nov 2021 11:57:36 +0100 Subject: [PATCH] minor ui changes --- fda-ui/components/dialogs/CreateDB.vue | 2 +- fda-ui/server-middleware/index.js | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fda-ui/components/dialogs/CreateDB.vue b/fda-ui/components/dialogs/CreateDB.vue index 93beb9d439..5e9f862982 100644 --- a/fda-ui/components/dialogs/CreateDB.vue +++ b/fda-ui/components/dialogs/CreateDB.vue @@ -1,7 +1,7 @@ <template> <div> - <v-progress-linear v-if="loading" :color="loadingColor" :indeterminate="!error" /> <v-card> + <v-progress-linear v-if="loading" :color="loadingColor" :indeterminate="!error" /> <v-card-title> Create Database </v-card-title> diff --git a/fda-ui/server-middleware/index.js b/fda-ui/server-middleware/index.js index 22a45baa83..a15a612909 100644 --- a/fda-ui/server-middleware/index.js +++ b/fda-ui/server-middleware/index.js @@ -32,12 +32,11 @@ app.post('/table_from_csv', upload.single('file'), async (req, res) => { headers: { 'Content-Type': 'application/json' } }) console.debug('analyzed', analysis) - analysis = await analysis.json() - if (!analysis.success) { - console.error('Failed to determine datatypes', analysis.message) - return res.json({ success: false, message: analysis.message }) + analysis = JSON.parse(await analysis.json()) + console.log(analysis) + if (!analysis.columns) { + return res.json({ success: false, message: 'Columns array missing' }) } - // analysis = JSON.parse(analysis) } catch (error) { console.error('failed to analyze', error) return res.json({ success: false, error }) -- GitLab