Last active
December 21, 2015 14:19
-
-
Save knownasilya/6319102 to your computer and use it in GitHub Desktop.
Ember Model findQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.User.adapter = App.DjangoAdapter.create({ | |
find: function (record, id, options) { | |
var params = options.params || {}; | |
if (!Ember.isEmpty(id) && !Ember.isEmpty(params.password)) { | |
return this.post('/accounts/api/signin/', { | |
identification: id, | |
password: params.password | |
}).then(function (data) { | |
console.dir(data); | |
Ember.run(record, record.load, id, data.user); | |
//return record; | |
}); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment