This commit is contained in:
Jabir 2023-11-03 12:01:21 +01:00
parent a6f2a4fac7
commit ab514bfcf5

View file

@ -13,12 +13,16 @@ class ClearQueuePrinterController
public function __invoke(string $id)
{
//todo fetch printer from request instead of doing it on controller
$printer = Printer::find($id);
//todo validate from rquest class
$data = request()->input('params');
$baseUrl = 'http://' .$printer->config->networkFormat();
//todo create service class to send requests
$httpClient = Http::withHeaders([
// 'Accept-Language' => $integrationProfile->api_credentials['language'],
// 'Authorization' => $authToken,
@ -27,7 +31,6 @@ class ClearQueuePrinterController
$url = $baseUrl . '/server/job_queue/job';
$query = [];
$method = 'delete';
$response = $httpClient->{$method}($url, $method === 'get' ? $query : $data);