Using "post" when deleting, fixing deleting

This commit is contained in:
Michael 2021-08-02 19:18:44 +00:00
parent 686785049e
commit 88e276843e
5 changed files with 72 additions and 53 deletions

View file

@ -50,7 +50,7 @@ class ScheduledStatuses extends BaseApi
}
$condtion = ['id' => $parameters['id'], 'uid' => $uid];
$post = DBA::selectFirst('delayed-post', ['id'], $condtion);
$post = DBA::selectFirst('delayed-post', ['id', 'wid'], $condtion);
if (empty($post['id'])) {
DI::mstdnError()->RecordNotFound();
}
@ -59,6 +59,10 @@ class ScheduledStatuses extends BaseApi
DI::mstdnError()->RecordNotFound();
}
if (!DBA::delete('workerqueue', ['id' => $post['wid']])) {
DI::mstdnError()->RecordNotFound();
}
System::jsonExit([]);
}