Files
threshold-ui/addons/api/mirage/serializers/credential.js
T
2022-08-30 20:40:31 -05:00

22 lines
614 B
JavaScript

import ApplicationSerializer from './application';
export default ApplicationSerializer.extend({
modelName: 'credential',
_hashForModel(model) {
const json = ApplicationSerializer.prototype._hashForModel.apply(
this,
arguments
);
json.credential_store_id = model.credentialStoreId;
// in a real API, the password, private_key, and private_key_passphrase
// fields are not returned so we delete them from the response
delete json.attributes?.password;
delete json.attributes?.private_key;
delete json.attributes?.private_key_passphrase;
return json;
},
});