2014-12-26 00:01:02 +00:00
|
|
|
import ApplicationAdapter from 'ghost/adapters/application';
|
2015-11-23 07:48:08 -06:00
|
|
|
import SlugUrl from 'ghost/mixins/slug-url';
|
2014-08-06 16:48:18 +00:00
|
|
|
|
2015-11-23 07:48:08 -06:00
|
|
|
export default ApplicationAdapter.extend(SlugUrl, {
|
2015-10-28 11:36:45 +00:00
|
|
|
find(store, type, id) {
|
|
|
|
return this.findQuery(store, type, {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
|
2015-10-28 11:36:45 +00:00
|
|
|
findRecord(store, type, id, snapshot) {
|
2015-10-15 12:43:04 +01:00
|
|
|
let url = this.buildIncludeURL(store, type.modelName, id, snapshot, 'findRecord');
|
|
|
|
|
|
|
|
url += '&status=all';
|
|
|
|
|
|
|
|
return this.ajax(url, 'GET');
|
|
|
|
},
|
|
|
|
|
2015-10-28 11:36:45 +00:00
|
|
|
findAll(store, type, id) {
|
|
|
|
return this.query(store, type, {id, status: 'all'});
|
2014-07-20 21:48:24 +00:00
|
|
|
}
|
|
|
|
});
|