error-service
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "error-service", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "functions required to display errors", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -106,14 +106,8 @@ class ErrorQueries { | ||
query: ` | ||
MATCH (n1:User) | ||
WHERE n1.facebookId = $facebookId AND n1.recentFacebookAccessToken = $facebookAccessToken | ||
WITH n1 | ||
OPTIONAL MATCH (n2:Post) | ||
WHERE n2.id = $postId | ||
WITH n1,n2 | ||
RETURN n2 | ||
OPTIONAL MATCH (n:Post) | ||
WHERE n.id = $postId | ||
RETURN n | ||
`, | ||
params: function (facebookId, facebookAccessToken, postId) { | ||
params: function (postId) { | ||
return { | ||
facebookId: facebookId, | ||
facebookAccessToken: facebookAccessToken, | ||
postId: postId | ||
@@ -146,14 +140,8 @@ }; | ||
query: ` | ||
MATCH (n1:User) | ||
WHERE n1.facebookId = $facebookId AND n1.recentFacebookAccessToken = $facebookAccessToken | ||
WITH n1 | ||
OPTIONAL MATCH (n2:Moment) | ||
WHERE n2.id = $momentId | ||
WITH n1,n2 | ||
RETURN n2 | ||
OPTIONAL MATCH (n:Moment) | ||
WHERE n.id = $momentId | ||
RETURN n | ||
`, | ||
params: function (facebookId, facebookAccessToken, postId) { | ||
params: function (momentId) { | ||
return { | ||
facebookId: facebookId, | ||
facebookAccessToken: facebookAccessToken, | ||
momentId: momentId | ||
@@ -189,3 +177,3 @@ }; | ||
`, | ||
params: function (facebookId, facebookAccessToken, commentId) { | ||
params: function (commentId) { | ||
return { | ||
@@ -192,0 +180,0 @@ commentId: commentId |
@@ -84,4 +84,4 @@ const { ErrorQueries } = require("./../queries/ErrorQueries.js") | ||
checkIfPostExists(facebookId, facebookAccessToken, postId) { | ||
return executeQuery(errorQueries.checkIfPostExists.query, errorQueries.checkIfPostExists.params(facebookId, facebookAccessToken, postId), this.driver) | ||
checkIfPostExists(postId) { | ||
return executeQuery(errorQueries.checkIfPostExists.query, errorQueries.checkIfPostExists.params(postId), this.driver) | ||
.then(records => { | ||
@@ -115,4 +115,4 @@ if (records[0]) { | ||
checkIfMomentExists(facebookId, facebookAccessToken, momentId) { | ||
return executeQuery(errorQueries.checkIfMomentExists.query, errorQueries.checkIfMomentExists.params(facebookId, facebookAccessToken, momentId), this.driver) | ||
checkIfMomentExists(momentId) { | ||
return executeQuery(errorQueries.checkIfMomentExists.query, errorQueries.checkIfMomentExists.params(momentId), this.driver) | ||
.then(records => { | ||
@@ -146,4 +146,4 @@ if (records[0]) { | ||
checkIfCommentExists(facebookId, facebookAccessToken, commentId) { | ||
return executeQuery(errorQueries.checkIfCommentExists.query, errorQueries.checkIfCommentExists.params(facebookId, facebookAccessToken, commentId), this.driver) | ||
checkIfCommentExists(commentId) { | ||
return executeQuery(errorQueries.checkIfCommentExists.query, errorQueries.checkIfCommentExists.params(commentId), this.driver) | ||
.then(records => { | ||
@@ -150,0 +150,0 @@ if (records[0]) { |
15459
444