diff --git a/lib/BackendClient.js b/lib/BackendClient.js index cf4d2aa7..e5085ac5 100644 --- a/lib/BackendClient.js +++ b/lib/BackendClient.js @@ -280,8 +280,7 @@ var BackendClient = (function(){ logger.debug("[%s] Calling flavorParamsListAction. Hostname: [%s], serverIndex: [%s], Application: [%s]", entryObject.entryId, mediaServerHostname, entryObject.serverType, applicationName); //Impersonate call to the entry's partnerId to execute the call in the partner's context - let partnerId = entryObject.partnerId; - client.setPartnerId(partnerId); + client.setPartnerId(entryObject.partnerId); filter.idIn = flavors.join(','); client.flavorParams.listAction((result, error, headers)=> { printAPIResponse(result, headers); @@ -296,7 +295,8 @@ var BackendClient = (function(){ deferred.resolve(res); }, filter); - + //Remove impersonation + client.setPartnerId(partnerId); return deferred.promise; } @@ -418,7 +418,8 @@ var BackendClient = (function(){ deferred.reject(new Error(errMsg)); } }); - + //Remove impersonation + client.setPartnerId(partnerId); return deferred.promise; } @@ -506,7 +507,6 @@ var BackendClient = (function(){ function registerToPush(templateSystemName, partnerIdToRegister, params) { const deferred = Q.defer(); - client.setPartnerId(partnerIdToRegister); const userParams = {}; userParams.userParams = _.map(params,