Merge pull request #3647 from lehni/model/fix-updateonly-props-check

Handle missing getUpdateOnlyProperties fn on Model
This commit is contained in:
Miroslav Bajtoš 2017-10-09 17:00:55 +02:00 committed by GitHub
commit fb8f3d9df3
1 changed files with 2 additions and 1 deletions

View File

@ -766,7 +766,8 @@ module.exports = function(registry) {
// if there is atleast one updateOnly property, then we set
// createOnlyInstance flag in __create__ to indicate loopback-swagger
// code to create a separate model instance for create operation only
const updateOnlyProps = this.getUpdateOnlyProperties();
const updateOnlyProps = this.getUpdateOnlyProperties ?
this.getUpdateOnlyProperties() : false;
const hasUpdateOnlyProps = updateOnlyProps && updateOnlyProps.length > 0;
var isStatic = scope.isStatic;