Skip to content

Commit

Permalink
Merge pull request #37 from openhealthcare/handle-when-we-have-more-t…
Browse files Browse the repository at this point in the history
…han-one

for the time being, more than 1 is an array, 1 is an object, none is …
  • Loading branch information
davidmiller committed Jul 15, 2016
2 parents 0ed452e + 66dec0c commit af1fd29
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pathway/static/js/pathway/services/multi_stage_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,12 @@ angular.module('opal.services').provider('multistage', function(){
return record.makeCopy();
});
clonedEpisode[key] = copies;
if(copies.length > 0){
if(copies.length > 1){
newScope.editing[key] = copies
}
else if(copies.length === 1){
newScope.editing[key] = copies[0]

}else{
newScope.editing[key] = {}
}
Expand Down

0 comments on commit af1fd29

Please sign in to comment.