|
|
@ -28,10 +28,9 @@ require('./diffs')(Posts);
|
|
|
|
require('./uploads')(Posts);
|
|
|
|
require('./uploads')(Posts);
|
|
|
|
|
|
|
|
|
|
|
|
Posts.exists = async function (pids) {
|
|
|
|
Posts.exists = async function (pids) {
|
|
|
|
const isArray = Array.isArray(pids);
|
|
|
|
return await db.exists(
|
|
|
|
pids = isArray ? pids : [pids];
|
|
|
|
Array.isArray(pids) ? pids.map(pid => `post:${pid}`) : `post:${pids}`
|
|
|
|
const exists = await db.exists(pids.map(pid => `post:${pid}`));
|
|
|
|
);
|
|
|
|
return isArray ? exists : exists[0];
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Posts.getPidsFromSet = async function (set, start, stop, reverse) {
|
|
|
|
Posts.getPidsFromSet = async function (set, start, stop, reverse) {
|
|
|
|