Fix location_code filter in stream method: handle empty string and trim whitespace

This commit is contained in:
mwpn
2025-12-17 17:55:35 +07:00
parent 2760f1a8f7
commit d2b4def127

View File

@@ -48,8 +48,10 @@ class RealtimeController
: 0; : 0;
$locationCode = $queryParams['location_code'] ?? null; $locationCode = $queryParams['location_code'] ?? null;
if ($locationCode !== null && !is_string($locationCode)) { if ($locationCode !== null && (!is_string($locationCode) || trim($locationCode) === '')) {
$locationCode = null; $locationCode = null;
} else if ($locationCode !== null) {
$locationCode = trim($locationCode);
} }
// Get response body stream // Get response body stream