Skip to content

Commit

Permalink
feat(edit-logs): cleanup editLog's data for update and delete too
Browse files Browse the repository at this point in the history
  • Loading branch information
naholyr committed Sep 5, 2017
1 parent 9a43f86 commit 0f2bbf5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/lib/edit-logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const middleware = schema => {
}

if (this.isNew) {
editLog.data = removeEmptyFields(data)
editLog.data = removeEmptyFields(cleanupData(data))
}
else {
// If the model was updated, we only store a diff
Expand Down Expand Up @@ -118,7 +118,7 @@ const middleware = schema => {
model: modelName,
item: doc.id,
date: new Date(),
data: removeEmptyFields(doc.toObject()),
data: removeEmptyFields(cleanupData(doc.toObject())),
action: 'delete',
who
})
Expand Down

0 comments on commit 0f2bbf5

Please sign in to comment.