From 12f3f56b01f3f45a551e11308296cfc1f036ccde Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Fri, 26 Oct 2018 14:31:30 -0400 Subject: [PATCH] change to .exists --- src/categories/index.js | 2 +- src/posts/index.js | 2 +- src/topics/index.js | 2 +- src/user/index.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/categories/index.js b/src/categories/index.js index 062fd2a6bf..4140bf154f 100644 --- a/src/categories/index.js +++ b/src/categories/index.js @@ -21,7 +21,7 @@ require('./recentreplies')(Categories); require('./update')(Categories); Categories.exists = function (cid, callback) { - db.isSortedSetMember('categories:cid', cid, callback); + db.exists('category:' + cid, callback); }; Categories.getCategoryById = function (data, callback) { diff --git a/src/posts/index.js b/src/posts/index.js index fee8ce4af7..3c7ee4d3fc 100644 --- a/src/posts/index.js +++ b/src/posts/index.js @@ -30,7 +30,7 @@ require('./diffs')(Posts); require('./uploads')(Posts); Posts.exists = function (pid, callback) { - db.isSortedSetMember('posts:pid', pid, callback); + db.exists('post:' + pid, callback); }; Posts.getPidsFromSet = function (set, start, stop, reverse, callback) { diff --git a/src/topics/index.js b/src/topics/index.js index 799cf165d5..0b54321eb1 100644 --- a/src/topics/index.js +++ b/src/topics/index.js @@ -34,7 +34,7 @@ require('./bookmarks')(Topics); require('./merge')(Topics); Topics.exists = function (tid, callback) { - db.isSortedSetMember('topics:tid', tid, callback); + db.exists('topic:' + tid, callback); }; Topics.getTopicsFromSet = function (set, uid, start, stop, callback) { diff --git a/src/user/index.js b/src/user/index.js index c17597ff38..d78184f8bb 100644 --- a/src/user/index.js +++ b/src/user/index.js @@ -112,7 +112,7 @@ User.getStatus = function (userData) { }; User.exists = function (uid, callback) { - db.isSortedSetMember('users:joindate', uid, callback); + db.exists('user:' + uid, callback); }; User.existsBySlug = function (userslug, callback) {