Fix job dispatch and show log output
All checks were successful
Deploy App / deploy (push) Successful in 11s
All checks were successful
Deploy App / deploy (push) Successful in 11s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user