Fix commands
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user