chore: 🤖 upgrade api addon to ember lts 3.20
This commit is contained in:
16 files changed
+66
-107
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import RESTAdapter from '@ember-data/adapter/rest';
|
||||
import { serializeIntoHash } from '@ember-data/adapter/-private';
|
||||
/* eslint-disable-next-line ember/no-mixins */
|
||||
import AdapterBuildURLMixin from '../mixins/adapter-build-url';
|
||||
import config from 'ember-get-config';
|
||||
import { get, getWithDefault } from '@ember/object';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import Mixin from '@ember/object/mixin';
|
||||
import { get } from '@ember/object';
|
||||
|
||||
/**
|
||||
* Overrides URL-building methods in an adpater for greater flexibility.
|
||||
@@ -12,6 +11,7 @@ import { get } from '@ember/object';
|
||||
* way URLs are generated by default. Override methods in the adapter that
|
||||
* uses this mixin to alter generated URLs.
|
||||
*/
|
||||
/* eslint-disable-next-line ember/no-new-mixins */
|
||||
export default Mixin.create({
|
||||
// =methods
|
||||
|
||||
@@ -57,7 +57,7 @@ export default Mixin.create({
|
||||
_buildPrefixedURL(modelName, id, snapshot) {
|
||||
let path;
|
||||
let url = [];
|
||||
const host = get(this, 'host');
|
||||
const host = this.host;
|
||||
const prefix = this.urlPrefix(null, null, modelName, id, snapshot);
|
||||
if (modelName) {
|
||||
path = this.pathForType(modelName);
|
||||
|
||||
@@ -16,7 +16,7 @@ export default class AccountModel extends GeneratedAccountModel {
|
||||
* Convenience for getting username in account.
|
||||
* @type {string}
|
||||
*/
|
||||
@computed('type', 'attributes.{login_name}')
|
||||
@computed('type', 'attributes.login_name')
|
||||
get username() {
|
||||
let username = '';
|
||||
switch (this.type) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import Model from '@ember-data/model';
|
||||
import { fragment } from 'ember-data-model-fragments/attributes';
|
||||
import { computed } from '@ember/object';
|
||||
import { get } from '@ember/object';
|
||||
|
||||
/**
|
||||
* Base model class provides common functionality for all models.
|
||||
@@ -51,7 +50,7 @@ export default class BaseModel extends Model {
|
||||
*/
|
||||
@computed('scope.scope_id')
|
||||
get scopeID() {
|
||||
return get(this, 'scope.scope_id');
|
||||
return this?.scope?.scope_id;
|
||||
}
|
||||
set scopeID(id) {
|
||||
if (!this.scope) this.scope = {};
|
||||
|
||||
@@ -23,7 +23,7 @@ export default class GroupModel extends GeneratedGroupModel {
|
||||
* @type {[UserModel]}
|
||||
*/
|
||||
// TODO: Use fragments array to read cross scope members.
|
||||
@computed('member_ids.[]')
|
||||
@computed('member_ids.[]', 'store')
|
||||
get members() {
|
||||
return this.member_ids
|
||||
.map((id) => this.store.peekRecord('user', id))
|
||||
|
||||
@@ -26,7 +26,7 @@ export default class TargetModel extends GeneratedTargetModel {
|
||||
* instances). Unresolvable instances are excluded from the array.
|
||||
* @type {[{model: HostSetModel, hostCatalog: HostCatalogModel}]}
|
||||
*/
|
||||
@computed('host_sets.[]')
|
||||
@computed('host_sets.[]', 'store')
|
||||
get hostSets() {
|
||||
return this.host_sets
|
||||
.map(({ host_set_id, host_catalog_id }) => ({
|
||||
|
||||
Reference in new issue
Block a user