Fix job dispatch and show log output
All checks were successful
Deploy App / deploy (push) Successful in 11s

This commit is contained in:
2025-09-04 17:38:30 +02:00
parent 6a72b7150b
commit 1565df568d
7 changed files with 45 additions and 15 deletions

View File

@@ -3,8 +3,7 @@
namespace App\Bots;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Facades\Log;
use Illuminate\Http\JsonResponse;
class GenericApi implements BotContract
{
@@ -17,7 +16,7 @@ class GenericApi implements BotContract
$this->config = $config;
}
public function run(): void
public function run(): JsonResponse
{
$this->client = new Client();
@@ -31,11 +30,16 @@ class GenericApi implements BotContract
$options['json'] = json_decode($this->config['body'], true);
}
$this->client->request(
$response = $this->client->request(
$this->config['method'] ?? 'GET',
$this->config['url'],
$options
);
return response()->json([
'status' => $response->getStatusCode(),
'body' => json_decode((string) $response->getBody(), true),
]);
}
public static function configSchema(): array