Files
threshold-ui/addons/api/addon/serializers/credential-library.js
T
Randall Morey 890cfe5168 Refactor attributes fragments (#1156)
* refactor: 💡 migrate managed-group off fragments

* refactor: 💡 migrate credential-store off fragments

* refactor: 💡 migrate credential-library off fragments

* refactor: 💡 migrate account off fragments
2022-06-28 19:30:26 -04:00

19 lines
541 B
JavaScript

import ApplicationSerializer from './application';
export default class CredentialLibrarySerializer extends ApplicationSerializer {
/**
* @override
* @method serialize
* @param {Snapshot} snapshot
*/
serialize() {
const serialized = super.serialize(...arguments);
if (serialized.attributes) {
// Serialize `http_request_body` only if `http_method` is POST
if (!serialized.attributes?.http_method?.match(/post/i))
delete serialized.attributes.http_request_body;
}
return serialized;
}
}