Skip to content

Commit

Permalink
fix save mode fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Orit Persik committed Jun 17, 2018
1 parent 6e23e67 commit 701ae15
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/controllers/entity.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ async function insert(userId, entity) {
async function checkUniqueMode(entity, body, params) {
// body for update mode name
// params for clone mode
let modeName = body.modes ? body.modes[0].name : `${params.modeName} (copy)`

// update fields in existing mode
if (body.modes && body.modes[0].name === params.modeName) return await true;

let modeName = body.modes ? body.modes[0].name : `${params.modeName} (copy)`;

let result = entity.modes.find(e => {
return e.name === modeName
Expand Down

0 comments on commit 701ae15

Please sign in to comment.