Skip to content

Commit

Permalink
fix: exempt ST from being del/res via last main posts (#9468)
Browse files Browse the repository at this point in the history
  • Loading branch information
gasoved committed Apr 7, 2021
1 parent 4264b23 commit a0dd908
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/api/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ async function deleteOrRestore(caller, data, params) {
}

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
await apiHelpers.doTopicAction(
command,
Expand Down

0 comments on commit a0dd908

Please sign in to comment.