diff --git a/lib/read-only.js b/lib/read-only.js index 15d6ea1..a20301c 100644 --- a/lib/read-only.js +++ b/lib/read-only.js @@ -106,6 +106,13 @@ module.exports = Model => { } return next() }) + + Model.beforeRemote(`prototype.__create__${relationName}`, (ctx, modelInstance, next) => { + if (typeof AffectedModel.stripReadOnlyProperties === 'function') { + return AffectedModel.stripReadOnlyProperties(modelName, ctx, modelInstance, next) + } + return next() + }) } })