I have a json type payload model.
content.json
...
"properties": {
"payload": {
"type": "object",
"required": true
}
},
...
I would like to protect part of it from being overwritten when calling updateAttributes.
Content.beforeRemote('prototype.updateAttributes', function (ctx, unused, next) {
if (ctx.instance && ctx.instance.contentTypeId === 'folder') {
}
next();
});
What is the best way to achieve this?
Neither
delete ctx.req.body.payload.items
neither
delete ctx.args.data.payload.items
neither
delete ctx.instance.payload.items
does what i want.
Do I need to completely override the updateAttributes method?
source
share