chore: 🤖 do not serialize fields with name disabled

This commit is contained in:
Randall Morey committed 2020-05-21 12:21:52 -04:00
1 parent 3da21e4a8e
commit 28f28d96f4
2 files changed
+8 -2

No files matched your search

+7 -1
View File
@@ -29,7 +29,13 @@ export default class ApplicationSerializer extends RESTSerializer {
* @param {Object} attribute
*/
serializeAttribute(snapshot, json, key, { options }) {
return options.readOnly ? null : super.serializeAttribute(...arguments);
let value = super.serializeAttribute(...arguments);
// Do not serialize read-only attributes.
if (options.readOnly) delete json[key];
// Do not serialize `disabled` fields.
// TODO: disabled is temporarily disabled
if (key === 'disabled') delete json[key];
return value;
}
/**
@@ -22,7 +22,7 @@ module('Unit | Serializer | application', function (hooks) {
assert.deepEqual(serializedRecord, {
name: 'Project',
description: 'Description',
disabled: false,
//disabled: false, // TODO: disabled is temporarily disabled
});
});