Update center added alert message

This commit is contained in:
Cüneyt Şentürk
2023-04-25 09:46:22 +03:00
parent 3400f006af
commit 8fbee840ea
10 changed files with 163 additions and 28 deletions

View File

@ -55,15 +55,24 @@ trait SiteApi
return $response;
}
public static function getResponseData($method, $path, $data = [], $status_code = 200)
public static function getResponseBody($method, $path, $data = [], $status_code = 200)
{
if (!$response = static::getResponse($method, $path, $data, $status_code)) {
if (! $response = static::getResponse($method, $path, $data, $status_code)) {
return [];
}
$body = json_decode($response->getBody());
if (!is_object($body)) {
return $body;
}
public static function getResponseData($method, $path, $data = [], $status_code = 200)
{
if (! $body = static::getResponseBody($method, $path, $data, $status_code)) {
return [];
}
if (! is_object($body)) {
return [];
}