Chore/remove is object
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import csvParser from 'csvtojson'
|
||||
import isObject from 'isobject'
|
||||
import {
|
||||
getSchema,
|
||||
tryToImportWithDelete,
|
||||
@@ -7,6 +6,7 @@ import {
|
||||
updateCycleStartsForAllCycleDays,
|
||||
} from '../../db'
|
||||
import getColumnNamesForCsv from './get-csv-column-names'
|
||||
import replaceWithNullIfAllPropertiesAreNull from './replace-with-null'
|
||||
import { LocalDate } from '@js-joda/core'
|
||||
import labels from '../../i18n/en/settings'
|
||||
|
||||
@@ -74,17 +74,6 @@ function validateHeaders(headers) {
|
||||
|
||||
function putNullForEmptySymptoms(data) {
|
||||
data.forEach(replaceWithNullIfAllPropertiesAreNull)
|
||||
|
||||
function replaceWithNullIfAllPropertiesAreNull(obj) {
|
||||
Object.keys(obj).forEach((key) => {
|
||||
if (!isObject(obj[key])) return
|
||||
if (Object.values(obj[key]).every((val) => val === null)) {
|
||||
obj[key] = null
|
||||
return
|
||||
}
|
||||
replaceWithNullIfAllPropertiesAreNull(obj[key])
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function getDbType(modelProperties, path) {
|
||||
|
||||
Reference in New Issue
Block a user