Merge branch 'develop' into chore-errors

This commit is contained in:
Randall Morey authored and GitHub committed 2020-06-05 13:27:34 -04:00
commit 9ae5389ff2
13 files changed
+131 -12

No files matched your search

+13
View File
@@ -2,6 +2,8 @@ import RESTAdapter from '@ember-data/adapter/rest';
import config from 'ember-get-config';
import { get } from '@ember/object';
import { InvalidError } from '@ember-data/adapter/error';
import { dasherize } from '@ember/string';
import { pluralize } from 'ember-inflector';
export default class ApplicationAdapter extends RESTAdapter {
// =attributes
@@ -22,6 +24,17 @@ export default class ApplicationAdapter extends RESTAdapter {
// =methods
/**
* Transforms the type to a dasherized string used in our API paths.
*
* @override
* @param {string} type
* @return {string}
*/
pathForType(type) {
return dasherize(pluralize(type));
}
/**
* Overrides default ajax method by rewritting PUT requests as PATCH.
* PATCH is the request method used by our API for updates.
@@ -0,0 +1,6 @@
import ApplicationAdapter from './application';
import ScopeAdapterMixin from '../mixins/scope-adapter';
export default class HostCatalogAdapter extends ApplicationAdapter.extend(
ScopeAdapterMixin
) { }
@@ -0,0 +1,41 @@
import BaseModel from '../../models/base';
import { attr } from '@ember-data/model';
/**
* HostCatalog manages Hosts and HostSets
*/
export default class GeneratedHostCatalogModel extends BaseModel {
// =attributes
@attr('string', {
description: 'The type of the resource, to help differentiate schemas'
}) type;
@attr('string', {
description: 'Optional name for identification purposes'
}) name;
@attr('string', {
description: 'Optional user-set description for identification purposes'
}) description;
@attr('date', {
description: 'The time this resource was created\nOutput only.',
readOnly: true
}) created_time;
@attr('date', {
description: 'The time this resource was last updated\nOutput only.',
readOnly: true
}) updated_time;
@attr('boolean', {
description: 'Whether the catalog is disabled'
}) disabled;
@attr({
description: 'Attributes specific to the catalog type'
}) attributes;
}
+3
View File
@@ -0,0 +1,3 @@
import GeneratedHostCatalogModel from '../generated/models/host-catalog';
export default class HostCatalogModel extends GeneratedHostCatalogModel { }