From b4d2a17f126ce9fa4e1f1b85b4dfe3c436a8a77b Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 3 Sep 2021 12:47:33 +0200 Subject: [PATCH] Test Query User Profile Stats debugged --- Desktop/DesktopApp.js | 46 +++++++++++++++---- .../NT/Modules/ClientInterface.js | 1 - 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/Desktop/DesktopApp.js b/Desktop/DesktopApp.js index 19b8726a0..ab63aee68 100644 --- a/Desktop/DesktopApp.js +++ b/Desktop/DesktopApp.js @@ -17,8 +17,12 @@ exports.newDesktopApp = function newDesktopApp() { DK.webSocketsClient = SA.projects.network.modules.webSocketsClient.newNetworkModulesWebSocketsClient() await DK.webSocketsClient.initialize() - let queryMessage = { - equeryId: "123", + let queryMessage + let query + /* + Test Query User Profiles. + */ + queryMessage = { queryType: 0, emitterUserProfileId: DK.TEST_NETWORK_CLIENT_USER_PROFILE_ID, initialIndex: 'Last', @@ -26,21 +30,47 @@ exports.newDesktopApp = function newDesktopApp() { direction: 'Past' } - let query = { + query = { requestType: 'Query', - queryMessage : JSON.stringify(queryMessage ) + queryMessage: JSON.stringify(queryMessage) } await DK.webSocketsClient.sendMessage( JSON.stringify(query) ) - .then(showProfiles) - .catch(onError) - - function showProfiles(profiles){ + .then(showProfiles) + .catch(onError) + + function showProfiles(profiles) { console.log(profiles) } + /* + Test Query User Profile Stats. + */ + queryMessage = { + queryType: 1, + emitterUserProfileId: DK.TEST_NETWORK_CLIENT_USER_PROFILE_ID, + targetUserProfileId: DK.TEST_NETWORK_CLIENT_USER_PROFILE_ID + } + query = { + requestType: 'Query', + queryMessage: JSON.stringify(queryMessage) + } + + await DK.webSocketsClient.sendMessage( + JSON.stringify(query) + ) + .then(showProfilesStats) + .catch(onError) + + function showProfilesStats(profile) { + console.log(profile) + } + + /* + Error Handling + */ function onError(errorMessage) { console.log('[ERROR] Query not executed. ' + errorMessage) } diff --git a/Projects/Social-Trading/NT/Modules/ClientInterface.js b/Projects/Social-Trading/NT/Modules/ClientInterface.js index 9a0e7b57f..b74c0b675 100644 --- a/Projects/Social-Trading/NT/Modules/ClientInterface.js +++ b/Projects/Social-Trading/NT/Modules/ClientInterface.js @@ -145,7 +145,6 @@ exports.newSocialTradingModulesClientInterface = function newSocialTradingModule We expect here a JSON string with some or all of the following properties: { - "equeryId": "a8de78f0-c3e4-4a2a-b7e8-f659073969db", "queryType": 10, "emitterUserProfileId": "a8de78f0-c3e4-4a2a-b7e8-f659073969db", "targetUserProfileId": "a8de78f0-c3e4-4a2a-b7e8-f659073969db",