chore: 🤖 add host-catalog mock API

This commit is contained in:
Randall Morey committed 2020-06-04 16:53:37 -04:00
1 parent 7132b59a76
commit 5bb12f677d
6 files changed
+56 -12

No files matched your search

+13
View File
@@ -1,6 +1,8 @@
import RESTAdapter from '@ember-data/adapter/rest';
import config from 'ember-get-config';
import { get } from '@ember/object';
import { dasherize } from '@ember/string';
import { pluralize } from 'ember-inflector';
export default class ApplicationAdapter extends RESTAdapter {
// =attributes
@@ -21,6 +23,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.