Skip to content

Commit

Permalink
format: format the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Nov 14, 2024
1 parent 481d4d0 commit 5d39c78
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/controllers/nft.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ const getReputationScore = catchAsync(async function (req: Request, res: Respons
community: dynamicNftModule?.community,
});
logger.debug({ i, platform, supportedPlatforms: supportedPlatforms[i] });
// shouldPlatformExist(platform);
for (let j = 0; j < profiles.length; j++) {
const profile = profiles[j];
logger.debug({ i, j, profile, supportedPlatforms: supportedPlatforms[i] });
const temp = platform?.name as SupportedNeo4jPlatforms;
if (profile.profile.provider === supportedPlatforms[i]) {
const reputationScoreQuery = `
MATCH (:${NEO4J_PLATFORM_INFO[platform?.name as SupportedNeo4jPlatforms].member} {id: "${profile.profile.id}"})-[r:HAVE_METRICS {platformId: "${platform?.id}"}]->(a)
MATCH (:${NEO4J_PLATFORM_INFO[temp].member} {id: "${profile.profile.id}"})-[r:HAVE_METRICS {platformId: "${platform?.id}"}]->(a)
WITH r.date as metrics_date, r.closenessCentrality as memberScore
ORDER BY metrics_date DESC
LIMIT 1
MATCH (user:${NEO4J_PLATFORM_INFO[platform?.name as SupportedNeo4jPlatforms].member})-[user_r:HAVE_METRICS {platformId: "${platform?.id}", date: metrics_date}]->(user)
MATCH (user:${NEO4J_PLATFORM_INFO[temp].member})-[user_r:HAVE_METRICS {platformId: "${platform?.id}", date: metrics_date}]->(user)
WITH memberScore, MAX(user_r.closenessCentrality) as maxScore
RETURN memberScore / maxScore AS reputation_score
`;
Expand Down Expand Up @@ -100,10 +100,3 @@ function shouldProfileExist(profile: any) {
export default {
getReputationScore,
};

// const platform = await platformService.getPlatformByFilter({
// name: platforms[i],
// community: dynamicNftModule?.community,
// });
// const profile = profiles.find((p: any) => p.profile.provider === platform);
// // Do the Cypher || N/A ?? || drop-down for platforms

0 comments on commit 5d39c78

Please sign in to comment.