chore: 🤖 add host-catalog mock API
This commit is contained in:
6 files changed
+56
-12
No files matched your search
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user