style: format addons/api

This commit is contained in:
Susmitha Girumala committed 2020-09-16 14:29:02 -04:00
1 parent e2610d6a90
commit ec870acba8
62 files changed
+590 -521

No files matched your search

+4 -4
View File
@@ -7,7 +7,6 @@ import { copy } from 'ember-copy';
* Manages serialization/normalization of data to/from the API.
*/
export default class ApplicationSerializer extends RESTSerializer {
// =methods
/**
@@ -160,9 +159,11 @@ export default class ApplicationSerializer extends RESTSerializer {
* @return {object}
*/
normalizeMissingArrays(store, primaryModelClass, payload) {
const attrDefs = store._attributesDefinitionFor(primaryModelClass.modelName);
const attrDefs = store._attributesDefinitionFor(
primaryModelClass.modelName
);
if (attrDefs) {
Object.keys(attrDefs).forEach(key => {
Object.keys(attrDefs).forEach((key) => {
if (!payload[key] && attrDefs[key]?.options?.emptyArrayIfMissing) {
payload[key] = [];
}
@@ -187,5 +188,4 @@ export default class ApplicationSerializer extends RESTSerializer {
if (scopeID) normalizedHash.scope.scope_id = scopeID;
return super.normalize(typeClass, normalizedHash);
}
}