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.