mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: exempt ST from being del/res via last main posts (#9468)
This commit is contained in:
@@ -136,7 +136,11 @@ async function deleteOrRestore(caller, data, params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function deleteOrRestoreTopicOf(command, pid, caller) {
|
async function deleteOrRestoreTopicOf(command, pid, caller) {
|
||||||
const topic = await posts.getTopicFields(pid, ['tid', 'cid', 'deleted']);
|
const topic = await posts.getTopicFields(pid, ['tid', 'cid', 'deleted', 'scheduled']);
|
||||||
|
// exempt scheduled topics from being deleted/restored
|
||||||
|
if (topic.scheduled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// command: delete/restore
|
// command: delete/restore
|
||||||
await apiHelpers.doTopicAction(
|
await apiHelpers.doTopicAction(
|
||||||
command,
|
command,
|
||||||
|
|||||||
Reference in New Issue
Block a user