fix button and fix service sync simbg

This commit is contained in:
arifal
2025-02-14 00:23:50 +07:00
parent ac2f37d549
commit 4d32d4a110
19 changed files with 382 additions and 271 deletions

View File

@@ -42,8 +42,14 @@ class ServiceClient
}
$response = $this->client->request($method, $this->baseUrl . $url, $options);
$responseBody = (string) $response->getBody();
$resultResponse = json_decode($response->getBody(), true);
if (!str_contains($response->getHeaderLine('Content-Type'), 'application/json')) {
\Log::error('Unexpected response format: ' . $responseBody);
return $this->resError('API response is not JSON');
}
$resultResponse = json_decode($responseBody, true, 512, JSON_THROW_ON_ERROR);
return $this->resSuccess($resultResponse);
} catch (Exception $e) {
\Log::error('error from client service'. $e->getMessage());