false, 'ERROR' => 'missing_business_id']); } if (!isset($data['IsHiring'])) { apiAbort(['OK' => false, 'ERROR' => 'missing_is_hiring']); } $isHiring = $data['IsHiring'] ? 1 : 0; try { queryTimed("UPDATE Businesses SET IsHiring = ? WHERE ID = ?", [$isHiring, $businessId]); jsonResponse(['OK' => true, 'IsHiring' => $isHiring === 1]); } catch (Exception $e) { apiAbort(['OK' => false, 'ERROR' => 'server_error', 'MESSAGE' => $e->getMessage()]); }