This commit is contained in:
Lizandro Guarnizo
2026-01-25 23:03:46 -05:00
parent 95125a6708
commit c57581a507
3 changed files with 23 additions and 5 deletions
+8
View File
@@ -20,6 +20,14 @@ try {
exit;
}
// Only release hold if there's an active hold/request; otherwise return success quietly
$userFlags = $db->fetch('SELECT on_hold, advisor_requested FROM users WHERE id = :id', ['id' => $userId]);
if (empty($userFlags) || (empty($userFlags['on_hold']) && empty($userFlags['advisor_requested']))) {
// Nothing to release
echo json_encode(['success' => true, 'info' => 'no_hold_active']);
exit;
}
// Use BotService to release hold (sends notification and clears flags)
try {
require_once __DIR__ . '/../services/BotService.php';