Files
threshold-ui/addons/api/addon/serializers/credential-library.js
T

25 lines
621 B
JavaScript
Raw Normal View History

2021-07-08 11:38:41 -04:00
import ApplicationSerializer from './application';
2022-06-28 19:30:26 -04:00
export default class CredentialLibrarySerializer extends ApplicationSerializer {
// =properties
/**
* @type {boolean}
*/
serializeScopeID = false;
2022-06-28 19:30:26 -04:00
/**
* @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;
}
}