mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 19:21:04 +01:00
test: fix assert.reject calls
fix tests
This commit is contained in:
@@ -279,11 +279,17 @@ topicsAPI.markRead = async (caller, { tid }) => {
|
||||
};
|
||||
|
||||
topicsAPI.markUnread = async (caller, { tid }) => {
|
||||
if (!tid || caller.uid <= 0) {
|
||||
throw new Error('[[error:invalid-data]]');
|
||||
}
|
||||
await topics.markUnread(tid, caller.uid);
|
||||
topics.pushUnreadCount(caller.uid);
|
||||
};
|
||||
|
||||
topicsAPI.bump = async (caller, { tid }) => {
|
||||
if (!tid) {
|
||||
throw new Error('[[error:invalid-tid]]');
|
||||
}
|
||||
const isAdminOrMod = await privileges.topics.isAdminOrMod(tid, caller.uid);
|
||||
if (!isAdminOrMod) {
|
||||
throw new Error('[[error:no-privileges]]');
|
||||
|
||||
Reference in New Issue
Block a user