Files
threshold-ui/addons/api/mirage/serializers/credential.js
T
Zhihe Li bcf004b8a4 Reformat codebase with trailing commas in functions (#2006)
* style: 💄 Update trailing commas in API

* style: 💄 Update trailing commas in core

* style: 💄 Update trailing commas in rose

* style: 💄 Update trailing commas in admin

* style: 💄 Update trailing commas in desktop
2023-11-22 14:07:41 -05:00

27 lines
733 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
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;
delete json.attributes?.json_object;
return json;
},
});