From 10605e17e725a3dc41353a2dec9f6c37714ec51c Mon Sep 17 00:00:00 2001 From: stasbilay02 Date: Thu, 14 Nov 2024 01:56:07 +0300 Subject: [PATCH] install module to client --- .../controllers/ModuleShopRestController.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/modules/module_shop/controllers/ModuleShopRestController.php b/app/modules/module_shop/controllers/ModuleShopRestController.php index 613decd..19bee88 100644 --- a/app/modules/module_shop/controllers/ModuleShopRestController.php +++ b/app/modules/module_shop/controllers/ModuleShopRestController.php @@ -97,20 +97,12 @@ class ModuleShopRestController extends RestController $this->renderApi($res); } - public function actionInstall(int $id): void + public function actionInstall($id): void { $model = $this->model->where("id", $id)->first(); - - header('Content-type: application/zip'); - header('Content-Disposition: attachment; filename="' . $model->slug . '.igm"'); - header('Content-Length: ' . filesize(ROOT_DIR . $model->path_to_archive)); - -// Debug::dd(filesize(ROOT_DIR . $model->path_to_archive)); - readfile(ROOT_DIR . $model->path_to_archive); - - $model->installations++; $model->save(); + $this->renderApi($model->toArray()); } } \ No newline at end of file