refactor: remove exits check

This commit is contained in:
Barış Soner Uşaklı
2024-06-15 13:36:13 -04:00
parent 6e3b012b2a
commit 74dd2844a0

View File

@@ -111,10 +111,8 @@ function renderTimeago(event) {
} }
Events.get = async (tid, uid, reverse = false) => { Events.get = async (tid, uid, reverse = false) => {
const topics = require('.'); if (!tid) {
return [];
if (!await topics.exists(tid)) {
throw new Error('[[error:no-topic]]');
} }
let eventIds = await db.getSortedSetRangeWithScores(`topic:${tid}:events`, 0, -1); let eventIds = await db.getSortedSetRangeWithScores(`topic:${tid}:events`, 0, -1);