diff --git a/app/Controllers/Admin/Cloudflare/RecordController.php b/app/Controllers/Admin/Cloudflare/RecordController.php index c142536..3e283b0 100644 --- a/app/Controllers/Admin/Cloudflare/RecordController.php +++ b/app/Controllers/Admin/Cloudflare/RecordController.php @@ -10,6 +10,7 @@ use App\Helpers\Cloudflare\RecordHelper; use App\Models\Cloudflare\ZoneModel; use App\Services\Cloudflare\RecordService; use CodeIgniter\HTTP\RedirectResponse; +use App\Services\MyLogService; class RecordController extends CloudflareController { @@ -57,15 +58,20 @@ class RecordController extends CloudflareController } //생성 + // protected function create_process_result($message): RedirectResponse|string + // { + // $this->init(__FUNCTION__); + // helper(['form']); + // $this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []]; + // return view( + // strtolower($this->view_path . $this->getService()->getClassPath() . "/create_result"), + // data: ['viewDatas' => $this->getViewDatas()] + // ); + // } protected function create_process_result($message): RedirectResponse|string { - $this->init(__FUNCTION__); - helper(['form']); - $this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []]; - return view( - strtolower($this->view_path . $this->getService()->getClassPath() . "/create_result"), - data: ['viewDatas' => $this->getViewDatas()] - ); + MyLogService::save($this->getService(), __FUNCTION__, $this->myauth, $message, DEFAULTS['STATUS']); + return redirect()->to($this->myauth->popPreviousUrl())->with('error', $message); } protected function create_init(string $action, $fields = []): void { diff --git a/app/Controllers/Admin/Cloudflare/ZoneController.php b/app/Controllers/Admin/Cloudflare/ZoneController.php index c2e0287..387d83c 100644 --- a/app/Controllers/Admin/Cloudflare/ZoneController.php +++ b/app/Controllers/Admin/Cloudflare/ZoneController.php @@ -11,6 +11,7 @@ use CodeIgniter\HTTP\RedirectResponse; use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; use Psr\Log\LoggerInterface; +use App\Services\MyLogService; class ZoneController extends CloudflareController { @@ -64,13 +65,8 @@ class ZoneController extends CloudflareController //생성 protected function create_process_result($message): RedirectResponse|string { - $this->init(__FUNCTION__); - helper(['form']); - $this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []]; - return view( - strtolower($this->view_path . $this->getService()->getClassPath() . "/create_result"), - data: ['viewDatas' => $this->getViewDatas()] - ); + MyLogService::save($this->getService(), __FUNCTION__, $this->myauth, $message, DEFAULTS['STATUS']); + return redirect()->to($this->myauth->popPreviousUrl())->with('error', $message); } protected function create_init(string $action, $fields = []): void {