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