Files
threshold-ui/addons/api/mirage/serializers/credential.js
T
Cameron Perera 53eef5caeb feat: 🎸 Add SSH Private Key mirage support (#1261)
* feat: 🎸 Add SSH Private Key mirage support

Update mirage to mock SSH Private key credential types

✅ Closes: ICU-5647

* refactor: 💡 remove default case in credential mirage mock
2022-08-17 13:20:21 -05:00

22 lines
586 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 passphrase
// field is not returned so we delete it from the response
delete json.attributes?.password;
delete json.attributes?.private_key;
delete json.attributes?.passphrase;
return json;
},
});