Skip to content

Commit

Permalink
Merge pull request #70 from icecandy/simon_model_fix
Browse files Browse the repository at this point in the history
Fixes bug using a model with non-array returned data
  • Loading branch information
jasonkneen authored Dec 3, 2018
2 parents 467ef2a + 3d4b2a3 commit fc587e4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions reste.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,15 @@ var main = function() {

if (modelConfig.content) {

var results = e[modelConfig.content];
var result = e[modelConfig.content];

if (results.length === 1) {
options.success(results[0]);
if (result.length === 1) {
//result is an array with value as first entry
options.success(result[0]);
}
else {
//result is not an array
options.success(result);
}
} else {
// calls error handler if we have it defined and 201+ returned
Expand Down

0 comments on commit fc587e4

Please sign in to comment.