Skip to content

Commit

Permalink
Small adjustment in putScheme (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed Nov 13, 2020
1 parent 9a2f61b commit 9ecc05b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions services/schemes.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,10 @@ module.exports = class SchemeService {
// Prepare
scheme = await this.prepareAndCheckSchemeForAction(scheme, "update")

if (existing.created) {
scheme.created = existing.created
}
// Override _id, uri, and created properties
scheme._id = existing._id
scheme.uri = existing.uri
scheme.created = existing.created

// Write scheme to database
const result = await Scheme.replaceOne({ _id: scheme.uri }, scheme)
Expand Down

0 comments on commit 9ecc05b

Please sign in to comment.