From 8f74be633e475259815b6e00279ff1eb713e5c66 Mon Sep 17 00:00:00 2001 From: Tb Fajri Date: Thu, 31 Aug 2023 11:36:10 +0700 Subject: [PATCH] update --- .../Http/Controllers/Api/CorporateController.php | 16 ++++++++-------- app/Services/ImportService.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Modules/Internal/Http/Controllers/Api/CorporateController.php b/Modules/Internal/Http/Controllers/Api/CorporateController.php index b00e27e7..9b8bf00d 100644 --- a/Modules/Internal/Http/Controllers/Api/CorporateController.php +++ b/Modules/Internal/Http/Controllers/Api/CorporateController.php @@ -432,8 +432,8 @@ class CorporateController extends Controller $result_headers = array_keys($headers_map_to_table_fields); $result_headers = array_merge($result_headers, ['Ingest Code', 'Ingest Note']); - $import->read($fileRead); - $import->write($fileWrite, 'xsls'); + // $import->read($fileRead); + // $import->write($fileWrite, 'xsls'); $import->addArrayToRow($result_headers); } $doc_headers_indexes = []; @@ -462,16 +462,16 @@ class CorporateController extends Controller $corporateService->handleBenefitRow($corporate, $row_data); } // Write Success Result to File - $import->read($fileRead); - $import->write($fileWrite, 'xsls'); + // $import->read($fileRead); + // $import->write($fileWrite, 'xsls'); $result_headers = array_merge($row_data, ['Ingest Code' =>200, 'Ingest Note' => 'Success']); $import->addArrayToRow($result_headers, $sheet->getName()); } catch (ImportRowException $e) { // Write Data Validation Error to File - $import->read($fileRead); - $import->write($fileWrite, 'xsls'); + // $import->read($fileRead); + // $import->write($fileWrite, 'xsls'); $import->addArrayToRow(array_merge($row_data, [ 'Ingest Code' => $e->getCode(), 'Ingest Note' => $e->getMessage(), @@ -479,8 +479,8 @@ class CorporateController extends Controller } catch (\Exception $e) { // throw new \Exception($e); // Write Server Error to File - $import->read($fileRead); - $import->write($fileWrite, 'xsls'); + // $import->read($fileRead); + // $import->write($fileWrite, 'xsls'); $import->addArrayToRow(array_merge($row_data, [ 'Ingest Code' => 500, 'Ingest Note' => env('APP_DEBUG') ? $e->getMessage() : 'Server Error', diff --git a/app/Services/ImportService.php b/app/Services/ImportService.php index a5f91133..15bf5dac 100644 --- a/app/Services/ImportService.php +++ b/app/Services/ImportService.php @@ -78,7 +78,7 @@ class ImportService{ } } $newRow = $this->makeRow($array); - // $this->writer->addRow($newRow); + $this->writer->addRow($newRow); return $this; }