Update read-only.js#10
Update read-only.js#10devonatdomandtom wants to merge 4 commits intofullcube:masterfrom DomAndTom:master
Conversation
Added check to see if body is empty to prevent sql error 'syntax error at or near "WHERE"'
Removing whitespace
Removing last trailing whitespace
|
@ mrfelton I wonder if these are valid tests? If we're only updating readonly model attributes, shouldn't we return a 403? Can I amend the test? |
| if (properties) { | ||
| debug('Creating %s : Read only properties are %j', Model.modelName, properties); | ||
| Object.keys(properties).forEach(function(key) { | ||
| if (!properties) return next(err); |
There was a problem hiding this comment.
Is the response a 403 given a model using this mixin where the mixin options = an empty object?
There was a problem hiding this comment.
The error seems inappropriate in general if the goal is to address an empty body and subsequent SQL errors when using SQL connectors.
There was a problem hiding this comment.
Should we create a new error and response code you think?
There was a problem hiding this comment.
Actually, just noticed the SQL errors will happen for empty bodies against the remote to update attributes when using the SQL connectors... maybe the solution should be somewhere else at a lower level?
Added check to see if body is empty to prevent sql error 'syntax error at or near "WHERE"'