M3 Integration fixes
This commit is contained in:
@@ -128,7 +128,11 @@ class UserPickingStats5 extends Controller
|
||||
try {
|
||||
$response = Http::withBasicAuth((string) $request->header('php-auth-user'), (string) $request->header('php-auth-pw'))
|
||||
->get($url, ['dates' => $date, 'user' => $request->user, 'format' => 'json']);
|
||||
$data = $response->successful() ? (json_decode($response->body(), true) ?: []) : [];
|
||||
$data = [];
|
||||
if ($response->successful()) {
|
||||
$decoded = json_decode($response->body(), true);
|
||||
$data = is_array($decoded) ? $decoded : [];
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
Log::warning('M3 picking statistics unavailable', ['date' => $date, 'exception' => $e->getMessage()]);
|
||||
$data = [];
|
||||
|
||||
Reference in New Issue
Block a user