2014-12-26 00:01:02 +00:00
|
|
|
import ApplicationAdapter from 'ghost/adapters/application';
|
2014-08-06 16:48:18 +00:00
|
|
|
|
2015-08-19 12:55:40 +01:00
|
|
|
export default ApplicationAdapter.extend({
|
2014-08-06 16:48:18 +00:00
|
|
|
find: function (store, type, id) {
|
2014-12-26 00:01:02 +00:00
|
|
|
return this.findQuery(store, type, {id: id, status: 'all'});
|
2015-09-03 12:06:50 +01:00
|
|
|
},
|
|
|
|
|
2015-10-15 12:43:04 +01: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 12:06:50 +01:00
|
|
|
findAll: function (store, type, id) {
|
|
|
|
return this.query(store, type, {id: id, status: 'all'});
|
2014-07-20 21:48:24 +00:00
|
|
|
}
|
|
|
|
});
|