refactor: always returns array

This commit is contained in:
Barış Soner Uşaklı
2021-12-07 18:43:14 -05:00
parent 830166d120
commit 9627fa9029

View File

@@ -109,7 +109,6 @@ module.exports = function (User) {
} }
User.getPostIds = async function (uid, start, stop) { User.getPostIds = async function (uid, start, stop) {
const pids = await db.getSortedSetRevRange(`uid:${uid}:posts`, start, stop); return await db.getSortedSetRevRange(`uid:${uid}:posts`, start, stop);
return Array.isArray(pids) ? pids : [];
}; };
}; };