Handle missing getUpdateOnlyProperties fn

If the current scope does not define a getUpdateOnlyProperties
function, the updateOnlyProps value will now be set to false.
This commit is contained in:
Jürg Lehni 2017-10-09 09:19:47 +02:00
parent 8488da2e26
commit 826ee2aca8
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;