chore: 🤖 do not serialize fields with name disabled
This commit is contained in:
2 files changed
+8
-2
No files matched your search
@@ -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
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user