Fix commands

This commit is contained in:
2026-06-25 13:06:14 +02:00
parent 712d2b2161
commit 0fae5bbcd7
2 changed files with 11 additions and 5 deletions

View File

@@ -29,8 +29,10 @@ class XenforoApiService {
'XF-Api-User' => $customUserId ?? $this->superUserId,
])->get("{$this->apiUrl}/{$endpoint}");
if( !$response->ok() )
if( !$response->ok() ) {
\Illuminate\Support\Facades\Log::error("XF API error [{$response->status()}] on {$endpoint}: " . $response->body());
return null;
}
return $response->json();
}
@@ -42,8 +44,10 @@ class XenforoApiService {
'XF-Api-User' => $customUserId ?? $this->superUserId,
])->post("{$this->apiUrl}/{$endpoint}", $data);
if( !$response->ok() )
if( !$response->ok() ) {
\Illuminate\Support\Facades\Log::error("XF API error [{$response->status()}] on {$endpoint}: " . $response->body());
return null;
}
return $response->json();
}
@@ -55,8 +59,10 @@ class XenforoApiService {
'XF-Api-User' => $customUserId ?? $this->superUserId,
])->delete("{$this->apiUrl}/{$endpoint}", $data);
if( !$response->ok() )
if( !$response->ok() ) {
\Illuminate\Support\Facades\Log::error("XF API error [{$response->status()}] on {$endpoint}: " . $response->body());
return null;
}
return $response->json();
}