2021-04-27 11:17:32 +03:00
|
|
|
import ApplicationAdapter from 'ghost-admin/adapters/application';
|
2022-02-02 19:57:22 +03:00
|
|
|
import classic from 'ember-classic-decorator';
|
2021-04-27 11:17:32 +03:00
|
|
|
|
2022-02-02 19:57:22 +03:00
|
|
|
@classic
|
2022-05-11 20:11:54 +03:00
|
|
|
export default class Tier extends ApplicationAdapter {
|
2021-04-27 11:17:32 +03:00
|
|
|
queryRecord(store, type, query) {
|
|
|
|
if (query && query.id) {
|
|
|
|
let {id} = query;
|
|
|
|
delete query.id;
|
|
|
|
let url = this.buildURL(type.modelName, id, query, 'findRecord');
|
|
|
|
return this.ajax(url, 'GET', {data: query});
|
|
|
|
}
|
|
|
|
|
2022-02-02 19:57:22 +03:00
|
|
|
return super.queryRecord(...arguments);
|
|
|
|
}
|
2021-04-27 11:17:32 +03:00
|
|
|
|
2021-06-04 10:42:52 +03:00
|
|
|
urlForDeleteRecord() {
|
2022-02-02 19:57:22 +03:00
|
|
|
let url = super.urlForDeleteRecord(...arguments);
|
2021-04-27 11:17:32 +03:00
|
|
|
let parsedUrl = new URL(url);
|
|
|
|
|
|
|
|
return parsedUrl.toString();
|
|
|
|
}
|
2022-02-02 19:57:22 +03:00
|
|
|
}
|