mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: if the topic already existed in -1, move it to another category if one was passed in options
This commit is contained in:
@@ -63,6 +63,11 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
|
||||
let title;
|
||||
if (hasTid) {
|
||||
({ cid, mainPid } = await topics.getTopicFields(tid, ['tid', 'cid', 'mainPid']));
|
||||
|
||||
if (options.cid && cid === -1) {
|
||||
// Move topic
|
||||
await topics.tools.move(tid, { cid: options.cid, uid: 0 });
|
||||
}
|
||||
} else {
|
||||
// mainPid ok to leave as-is
|
||||
cid = options.cid || -1;
|
||||
|
||||
Reference in New Issue
Block a user