diff --git a/fda-ui/components/dialogs/CreateDB.vue b/fda-ui/components/dialogs/CreateDB.vue index 93beb9d4393c565574bbcd502764c324718f6c80..5e9f86298278f45bdb2322e3aaa52331b0c43068 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 22a45baa8397c42d871169411f1ed76d7c7b0398..a15a6129098c6b4d054d6500d64ca399147cd4a5 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 })