Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can.Model.findAll should reject if parseModels returns a non-array data property. #1662

Closed
m-mujica opened this issue May 1, 2015 · 0 comments · Fixed by #1663
Closed

can.Model.findAll should reject if parseModels returns a non-array data property. #1662

m-mujica opened this issue May 1, 2015 · 0 comments · Fixed by #1663
Assignees
Labels
Milestone

Comments

@m-mujica
Copy link
Contributor

m-mujica commented May 1, 2015

If you have the following code:

can.fixture("/mymodels", function () {
  return {
    status: 'success',
    message: ''
  };
});

var MyModel = can.Model.extend({
  findAll: "/mymodels",

  parseModels: function(raw) {
    raw.data = undefined;
    return raw;
  }
}, {});

MyModel.findAll({}).then(success, error);

The error callback should be called and not the success callback.

@m-mujica m-mujica added the bug label May 1, 2015
@m-mujica m-mujica self-assigned this May 1, 2015
m-mujica pushed a commit that referenced this issue May 1, 2015
@daffl daffl added this to the 2.2.6 milestone May 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants