error-service
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "error-service", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "functions required to display errors", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -24,2 +24,23 @@ class ErrorQueries { | ||
getStartNodeOfRelationship = { | ||
query: ` | ||
MATCH (n1:User) | ||
WHERE n1.facebookId = $fromFacebookId AND n1.recentFacebookAccessToken = $fromFacebookAccessToken | ||
WITH n1 | ||
MATCH (n2:User) | ||
WHERE n2.id = $toId AND n1.id <> $toId | ||
WITH n1,n2 | ||
OPTIONAL MATCH (n1)-[r]-(n2) | ||
WITH n1,n2,r | ||
RETURN startNode(r) | ||
`, | ||
params: function (fromFacebookId, fromFacebookAccessToken, toId) { | ||
return { | ||
fromFacebookId: fromFacebookId, | ||
fromFacebookAccessToken: fromFacebookAccessToken, | ||
toId: toId | ||
}; | ||
} | ||
}; | ||
areUsersFriendsWithMe = { | ||
@@ -26,0 +47,0 @@ query: ` |
@@ -26,2 +26,17 @@ const { ErrorQueries } = require("./../queries/ErrorQueries.js") | ||
getStartNodeOfRelationship(fromFacebookId, fromFacebookAccessToken, toId) { | ||
return executeQuery(errorQueries.getStartNodeOfRelationship.query, errorQueries.getStartNodeOfRelationship.params(fromFacebookId, fromFacebookAccessToken, toId), this.driver) | ||
.then(records => { | ||
if (records[0]) { | ||
if (records[0][0] != null) { | ||
return records[0][0]; | ||
} | ||
} | ||
}) | ||
.catch(error => { | ||
console.log(error); | ||
return { "error": error.toString() }; | ||
}); | ||
} | ||
areUsersFriendsWithMe(facebookId, facebookAccessToken, taggedUserIdArray) { | ||
@@ -28,0 +43,0 @@ return executeQuery(errorQueries.areUsersFriendsWithMe.query, errorQueries.areUsersFriendsWithMe.params(facebookId, facebookAccessToken, taggedUserIdArray), this.driver) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16270
456