mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Avoid running cypher statement if not needed
- it just feels safer to not run a cypher statement if there is no user in the idsOfUsers array. Why risk notifications pointing to empty nodes? It doesn't seem like this happens, but I'm not sure how to write a test to verify, and why run cypher statements, if there is no need to?
This commit is contained in:
parent
54caaaaa0a
commit
a346632fff
@ -53,6 +53,7 @@ const postAuthorOfComment = async (commentId, { context }) => {
|
||||
}
|
||||
|
||||
const notifyUsersOfMention = async (label, id, idsOfUsers, reason, context) => {
|
||||
if (!(idsOfUsers && idsOfUsers.length)) return []
|
||||
await validateNotifyUsers(label, reason)
|
||||
let mentionedCypher
|
||||
switch (reason) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user