From 2741a6d03b75f982dc87b85970dfe364ba120370 Mon Sep 17 00:00:00 2001 From: Jeremy Warner Date: Mon, 30 Jan 2023 17:00:29 -0800 Subject: [PATCH] talk id (not session) --- app/imports/api/comments/methods.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/imports/api/comments/methods.js b/app/imports/api/comments/methods.js index 7e02be11..23427261 100644 --- a/app/imports/api/comments/methods.js +++ b/app/imports/api/comments/methods.js @@ -10,6 +10,8 @@ const SlideSchema = new SimpleSchema({ slideId: { type: String }, }); +const lockedTalkId = "W3dadgycsieaxMESB"; + export const createComment = new ValidatedMethod({ name: "comments.create", validate: new SimpleSchema({ @@ -30,7 +32,7 @@ export const createComment = new ValidatedMethod({ const uTalk = Talks.findOne({ _id: talk }); // Locking the demo session. - if (!sess || sess._id == "W3dadgycsieaxMESB") { + if (!talk || talk == lockedTalkId) { console.error("Session is locked."); return false; } @@ -166,7 +168,7 @@ export const updateComment = new ValidatedMethod({ const comment = Comments.findOne({ _id: commentId }); // Locking the demo session. - if (!comment || comment.talk == "W3dadgycsieaxMESB") { + if (!comment || comment.talk == lockedTalkId) { console.error("Session is locked."); return false; }