mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Dropped use of @classic decorator in adapters
refs https://github.com/TryGhost/Ghost/issues/14101 - `@classic` decorator is not required on adapter classes - small cleanup of Octane migration code
This commit is contained in:
parent
4373369a51
commit
034812ac02
13 changed files with 2 additions and 28 deletions
|
@ -1,7 +1,5 @@
|
|||
import ApplicationAdapter from './application';
|
||||
import classic from 'ember-classic-decorator';
|
||||
|
||||
@classic
|
||||
export default class ApiKey extends ApplicationAdapter {
|
||||
queryRecord(store, type, query) {
|
||||
if (!query || query.id !== 'me') {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import EmbeddedRelationAdapter from 'ghost-admin/adapters/embedded-relation-adapter';
|
||||
import classic from 'ember-classic-decorator';
|
||||
|
||||
@classic
|
||||
export default class Application extends EmbeddedRelationAdapter {
|
||||
shouldBackgroundReloadRecord() {
|
||||
return false;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import ApplicationAdapter from './application';
|
||||
import classic from 'ember-classic-decorator';
|
||||
|
||||
@classic
|
||||
export default class Email extends ApplicationAdapter {
|
||||
retry(model) {
|
||||
let url = `${this.buildURL('email', model.get('id'))}retry/`;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import BaseAdapter from 'ghost-admin/adapters/base';
|
||||
import classic from 'ember-classic-decorator';
|
||||
import {get} from '@ember/object';
|
||||
import {isNone} from '@ember/utils';
|
||||
import {underscore} from '@ember/string';
|
||||
|
@ -14,7 +13,6 @@ import {underscore} from '@ember/string';
|
|||
// If a model has an embedded hasMany relation, the related type will be included:
|
||||
// roles: DS.hasMany('role', { embedded: 'always' }) => ?include=roles
|
||||
|
||||
@classic
|
||||
export default class EmbeddedRelationAdapter extends BaseAdapter {
|
||||
find(store, type, id, snapshot) {
|
||||
return this.ajax(this.buildIncludeURL(store, type.modelName, id, snapshot, 'find'), 'GET');
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
import ApplicationAdapter from 'ghost-admin/adapters/application';
|
||||
import SlugUrl from 'ghost-admin/utils/slug-url';
|
||||
import classic from 'ember-classic-decorator';
|
||||
|
||||
@classic
|
||||
export default class Label extends ApplicationAdapter {
|
||||
buildURL(_modelName, _id, _snapshot, _requestType, query) {
|
||||
let url = super.buildURL(...arguments);
|
||||
|
||||
return SlugUrl(url, query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import ApplicationAdapter from 'ghost-admin/adapters/application';
|
||||
import classic from 'ember-classic-decorator';
|
||||
|
||||
@classic
|
||||
export default class Member extends ApplicationAdapter {
|
||||
queryRecord(store, type, query) {
|
||||
if (query && query.id) {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import ApplicationAdapter from 'ghost-admin/adapters/application';
|
||||
import classic from 'ember-classic-decorator';
|
||||
|
||||
@classic
|
||||
export default class Offer extends ApplicationAdapter {
|
||||
queryRecord(store, type, query) {
|
||||
if (query && query.id) {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import ApplicationAdapter from 'ghost-admin/adapters/application';
|
||||
import classic from 'ember-classic-decorator';
|
||||
|
||||
@classic
|
||||
export default class Page extends ApplicationAdapter {
|
||||
// posts and pages now include everything by default
|
||||
buildIncludeURL(store, modelName, id, snapshot, requestType, query) {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import ApplicationAdapter from 'ghost-admin/adapters/application';
|
||||
import classic from 'ember-classic-decorator';
|
||||
|
||||
@classic
|
||||
export default class Setting extends ApplicationAdapter {
|
||||
updateRecord(store, type, record) {
|
||||
let data = {};
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
import ApplicationAdapter from 'ghost-admin/adapters/application';
|
||||
import SlugUrl from 'ghost-admin/utils/slug-url';
|
||||
import classic from 'ember-classic-decorator';
|
||||
|
||||
@classic
|
||||
export default class Tag extends ApplicationAdapter {
|
||||
buildURL(_modelName, _id, _snapshot, _requestType, query) {
|
||||
let url = super.buildURL(...arguments);
|
||||
|
||||
return SlugUrl(url, query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import ApplicationAdapter from './application';
|
||||
import classic from 'ember-classic-decorator';
|
||||
|
||||
@classic
|
||||
export default class Theme extends ApplicationAdapter {
|
||||
activate(model) {
|
||||
let url = `${this.buildURL('theme', model.get('id'))}activate/`;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import ApplicationAdapter from 'ghost-admin/adapters/application';
|
||||
import classic from 'ember-classic-decorator';
|
||||
|
||||
@classic
|
||||
export default class Tier extends ApplicationAdapter {
|
||||
queryRecord(store, type, query) {
|
||||
if (query && query.id) {
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import ApplicationAdapter from 'ghost-admin/adapters/application';
|
||||
import SlugUrl from 'ghost-admin/utils/slug-url';
|
||||
import classic from 'ember-classic-decorator';
|
||||
|
||||
@classic
|
||||
export default class User extends ApplicationAdapter {
|
||||
buildURL(_modelName, _id, _snapshot, _requestType, query) {
|
||||
let url = super.buildURL(...arguments);
|
||||
|
|
Loading…
Add table
Reference in a new issue