From 735878b7ef25788c7de8b18e6890e63a331e1e68 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Wed, 22 Sep 2021 08:49:38 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20update=20internal=20var?= =?UTF-8?q?iable=20names?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/api/addon/serializers/target.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/addons/api/addon/serializers/target.js b/addons/api/addon/serializers/target.js index c287aca46..2df01d96d 100644 --- a/addons/api/addon/serializers/target.js +++ b/addons/api/addon/serializers/target.js @@ -17,14 +17,15 @@ export default class TargetSerializer extends ApplicationSerializer { */ serialize(snapshot) { let serialized = super.serialize(...arguments); - const hostSetIDs = snapshot?.adapterOptions?.hostSetIDs; - if (hostSetIDs) - serialized = this.serializeWithHostSets(snapshot, hostSetIDs); - const credentialLibraryIDs = snapshot?.adapterOptions?.credentialLibraryIDs; - if (credentialLibraryIDs) - serialized = this.serializeWithCredentialLibraries( + const hostSourceIDs = snapshot?.adapterOptions?.hostSetIDs; + if (hostSourceIDs) { + serialized = this.serializeWithHostSources(snapshot, hostSourceIDs); + } + const credentialSourceIDs = snapshot?.adapterOptions?.credentialLibraryIDs; + if (credentialSourceIDs) + serialized = this.serializeWithCredentialSources( snapshot, - credentialLibraryIDs + credentialSourceIDs ); return serialized; } @@ -36,10 +37,10 @@ export default class TargetSerializer extends ApplicationSerializer { * @param {[string]} hostSetIDs * @return {object} */ - serializeWithHostSets(snapshot, hostSetIDs) { + serializeWithHostSources(snapshot, hostSourceIDs) { return { version: snapshot.attr('version'), - host_set_ids: hostSetIDs, + host_set_ids: hostSourceIDs, }; } @@ -50,10 +51,10 @@ export default class TargetSerializer extends ApplicationSerializer { * @param {[string]} credentialLibraryIDs * @return {object} */ - serializeWithCredentialLibraries(snapshot, credentialLibraryIDs) { + serializeWithCredentialSources(snapshot, credentialSourceIDs) { return { version: snapshot.attr('version'), - application_credential_library_ids: credentialLibraryIDs, + application_credential_library_ids: credentialSourceIDs, }; } }