Test Query User Profile Stats debugged

This commit is contained in:
Luis Fernando Molina committed 2021-09-03 12:47:33 +02:00
1 parent 412f099ee9
commit b4d2a17f12
2 files changed
+38 -9

No files matched your search

+38 -8
View File
@@ -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)
}
@@ -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",