2014-12-26 03:01:02 +03:00
|
|
|
import ApplicationAdapter from 'ghost/adapters/application';
|
2014-08-06 20:48:18 +04:00
|
|
|
|
2015-08-19 14:55:40 +03:00
|
|
|
export default ApplicationAdapter.extend({
|
2014-08-06 20:48:18 +04:00
|
|
|
find: function (store, type, id) {
|
2014-12-26 03:01:02 +03:00
|
|
|
return this.findQuery(store, type, {id: id, status: 'all'});
|
2015-09-03 14:06:50 +03:00
|
|
|
},
|
|
|
|
|
2015-10-15 14:43:04 +03:00
|
|
|
// TODO: This is needed because the API currently expects you to know the
|
|
|
|
// status of the record before retrieving by ID. Quick fix is to always
|
|
|
|
// include status=all in the query
|
|
|
|
findRecord: function (store, type, id, snapshot) {
|
|
|
|
let url = this.buildIncludeURL(store, type.modelName, id, snapshot, 'findRecord');
|
|
|
|
|
|
|
|
url += '&status=all';
|
|
|
|
|
|
|
|
return this.ajax(url, 'GET');
|
|
|
|
},
|
|
|
|
|
2015-09-03 14:06:50 +03:00
|
|
|
findAll: function (store, type, id) {
|
|
|
|
return this.query(store, type, {id: id, status: 'all'});
|
2014-07-21 01:48:24 +04:00
|
|
|
}
|
|
|
|
});
|