mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
refactor: expose new method for appending moderation note
This commit is contained in:
@@ -301,8 +301,8 @@ SocketUser.setModerationNote = async function (socket, data) {
|
|||||||
if (!canEdit) {
|
if (!canEdit) {
|
||||||
throw new Error('[[error:no-privileges]]');
|
throw new Error('[[error:no-privileges]]');
|
||||||
}
|
}
|
||||||
await db.sortedSetAdd('uid:' + data.uid + ':moderation:notes', noteData.timestamp, noteData.timestamp);
|
|
||||||
await db.setObject('uid:' + data.uid + ':moderation:note:' + noteData.timestamp, noteData);
|
user.appendModerationNote({ uid: data.uid, noteData });
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketUser.deleteUpload = async function (socket, data) {
|
SocketUser.deleteUpload = async function (socket, data) {
|
||||||
|
|||||||
@@ -131,4 +131,9 @@ module.exports = function (User) {
|
|||||||
});
|
});
|
||||||
return noteData;
|
return noteData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
User.appendModerationNote = async ({ uid, noteData }) => {
|
||||||
|
await db.sortedSetAdd('uid:' + uid + ':moderation:notes', noteData.timestamp, noteData.timestamp);
|
||||||
|
await db.setObject('uid:' + uid + ':moderation:note:' + noteData.timestamp, noteData);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user