From ab514bfcf589db07b1ebff4c8bee401db288c1f5 Mon Sep 17 00:00:00 2001 From: Jabir Date: Fri, 3 Nov 2023 12:01:21 +0100 Subject: [PATCH] wip --- .../Controllers/Api/Printer/ClearQueuePrinterController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/Printer/ClearQueuePrinterController.php b/app/Http/Controllers/Api/Printer/ClearQueuePrinterController.php index 27de9fb..529d282 100644 --- a/app/Http/Controllers/Api/Printer/ClearQueuePrinterController.php +++ b/app/Http/Controllers/Api/Printer/ClearQueuePrinterController.php @@ -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);