Bug Fixed

This commit is contained in:
Luis Fernando Molina committed 2021-09-17 17:57:53 +02:00
1 parent 71de99b11b
commit a995068978
4 files changed
+20 -11

No files matched your search

@@ -59,17 +59,17 @@ exports.newSocialTradingModulesQueriesEvents = function newSocialTradingModulesQ
Any of the above happening, means that indeed it is related.
*/
let emitterUserProfile = NT.projects.socialTrading.globals.memory.maps.USER_PROFILES_BY_ID.get(eventReceived.emitterUserProfileId)
let emitterBotProfile = emitterUserProfile.bots.get(eventReceived.emitterBotProfileId)
let emitterPost = emitterUserProfile.posts.get(eventReceived.emitterPostHash)
let emitterUserProfile = NT.projects.socialTrading.globals.memory.maps.USER_PROFILES_BY_ID.get(event.emitterUserProfileId)
let emitterBotProfile = emitterUserProfile.bots.get(event.emitterBotProfileId)
let emitterPost = emitterUserProfile.posts.get(event.emitterPostHash)
let targetUserProfile = NT.projects.socialTrading.globals.memory.maps.USER_PROFILES_BY_ID.get(eventReceived.targetUserProfileId)
let targetUserProfile = NT.projects.socialTrading.globals.memory.maps.USER_PROFILES_BY_ID.get(event.targetUserProfileId)
let targetBotProfile
let targetPost
if (targetUserProfile !== undefined) {
targetBotProfile = targetUserProfile.bots.get(eventReceived.targetBotProfileId)
targetPost = targetUserProfile.posts.get(eventReceived.targetPostHash)
targetBotProfile = targetUserProfile.bots.get(event.targetBotProfileId)
targetPost = targetUserProfile.posts.get(event.targetPostHash)
}
/*
Test #1 : The Emitter or Target profile must be the same as the Context Profile.
@@ -51,6 +51,8 @@ exports.newSocialTradingModulesSocialGraphPost = function newSocialTradingModule
REACTION_CARE: 6
}
thisObject.replies = new Map()
thisObject.reactions = new Map()
thisObject.reactions.set(REACTION_TYPES.REACTION_LIKE, 0)
thisObject.reactions.set(REACTION_TYPES.REACTION_LOVE, 0)
@@ -54,7 +54,7 @@ exports.newSocialTradingModulesStorage = function newSocialTradingModulesStorage
}
let errorMessage = err.message
if (errorMessage === undefined) { errorMessage = err }
throw ('Could not apply the events from storage. ' + errorMessage)
console.log ('Could not apply the event from storage. -> errorMessage = ' + errorMessage)
}
}
}
@@ -4,7 +4,7 @@ exports.newSocialTradingUtilitiesQueriesValidations = function newSocialTradingU
*/
let thisObject = {
profilesValidations: profilesValidations,
postValidations: postValidations,
postValidations: postValidations,
arrayValidations: arrayValidations
}
@@ -14,6 +14,13 @@ exports.newSocialTradingUtilitiesQueriesValidations = function newSocialTradingU
/*
Validate User Profile
*/
if (queryReceived.emitterUserProfileId !== undefined) {
thisObject.profile = NT.projects.socialTrading.globals.memory.maps.USER_PROFILES_BY_ID.get(queryReceived.emitterUserProfileId)
if (thisObject.profile === undefined) {
throw ('Emitter User Profile Not Found.')
}
}
if (queryReceived.targetUserProfileId !== undefined) {
thisObject.profile = NT.projects.socialTrading.globals.memory.maps.USER_PROFILES_BY_ID.get(queryReceived.targetUserProfileId)
if (thisObject.profile === undefined) {
@@ -92,11 +99,11 @@ exports.newSocialTradingUtilitiesQueriesValidations = function newSocialTradingU
}
if (
queryReceived.direction !== SA.projects.socialTrading.globals.queryConstants.DIRECTION_FUTURE &&
queryReceived.direction !== SA.projects.socialTrading.globals.queryConstants.DIRECTION_FUTURE &&
queryReceived.direction !== SA.projects.socialTrading.globals.queryConstants.DIRECTION_PAST &&
queryReceived.direction !== SA.projects.socialTrading.globals.queryConstants.DIRECTION_UP &&
queryReceived.direction !== SA.projects.socialTrading.globals.queryConstants.DIRECTION_UP &&
queryReceived.direction !== SA.projects.socialTrading.globals.queryConstants.DIRECTION_DOWN
) {
) {
throw ('Direction Not Supported.')
}