wip
This commit is contained in:
parent
a6f2a4fac7
commit
ab514bfcf5
1 changed files with 4 additions and 1 deletions
|
@ -13,12 +13,16 @@ class ClearQueuePrinterController
|
||||||
|
|
||||||
public function __invoke(string $id)
|
public function __invoke(string $id)
|
||||||
{
|
{
|
||||||
|
//todo fetch printer from request instead of doing it on controller
|
||||||
$printer = Printer::find($id);
|
$printer = Printer::find($id);
|
||||||
|
|
||||||
|
//todo validate from rquest class
|
||||||
$data = request()->input('params');
|
$data = request()->input('params');
|
||||||
|
|
||||||
$baseUrl = 'http://' .$printer->config->networkFormat();
|
$baseUrl = 'http://' .$printer->config->networkFormat();
|
||||||
|
|
||||||
|
|
||||||
|
//todo create service class to send requests
|
||||||
$httpClient = Http::withHeaders([
|
$httpClient = Http::withHeaders([
|
||||||
// 'Accept-Language' => $integrationProfile->api_credentials['language'],
|
// 'Accept-Language' => $integrationProfile->api_credentials['language'],
|
||||||
// 'Authorization' => $authToken,
|
// 'Authorization' => $authToken,
|
||||||
|
@ -27,7 +31,6 @@ class ClearQueuePrinterController
|
||||||
$url = $baseUrl . '/server/job_queue/job';
|
$url = $baseUrl . '/server/job_queue/job';
|
||||||
|
|
||||||
$query = [];
|
$query = [];
|
||||||
|
|
||||||
$method = 'delete';
|
$method = 'delete';
|
||||||
$response = $httpClient->{$method}($url, $method === 'get' ? $query : $data);
|
$response = $httpClient->{$method}($url, $method === 'get' ? $query : $data);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue