Skip to content

Commit

Permalink
Merge pull request #668 from kaizumaki/feature/fix-update-lesson
Browse files Browse the repository at this point in the history
removeEmptyでDate型が除外されてしまうのを修正
  • Loading branch information
kaizumaki authored Jun 15, 2021
2 parents 87c1204 + 41b6c7b commit 6e9729b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import _ from 'lodash'

export const removeEmpty = (obj) => {
return _.transform(obj, function (result, value, key) {
if (!_.isEmpty(value) || _.isBoolean(value)) {
if (typeof value === 'object') {
if (!_.isEmpty(value) || _.isBoolean(value) || _.isDate(value)) {
if (typeof value === 'object' && !_.isDate(value)) {
result[key] = removeEmpty(value)
} else {
result[key] = value
Expand Down

0 comments on commit 6e9729b

Please sign in to comment.