feat: fix opecart module status, remove .vite
This commit is contained in:
@@ -4,23 +4,33 @@ namespace Bastion\Services;
|
|||||||
|
|
||||||
use Openguru\OpenCartFramework\Cache\CacheInterface;
|
use Openguru\OpenCartFramework\Cache\CacheInterface;
|
||||||
use Openguru\OpenCartFramework\OpenCart\Decorators\OcRegistryDecorator;
|
use Openguru\OpenCartFramework\OpenCart\Decorators\OcRegistryDecorator;
|
||||||
|
use Openguru\OpenCartFramework\QueryBuilder\Connections\ConnectionInterface;
|
||||||
|
use Openguru\OpenCartFramework\Support\Arr;
|
||||||
|
|
||||||
class SettingsService
|
class SettingsService
|
||||||
{
|
{
|
||||||
private OcRegistryDecorator $registry;
|
private OcRegistryDecorator $registry;
|
||||||
private CacheInterface $cache;
|
private CacheInterface $cache;
|
||||||
|
private ConnectionInterface $connection;
|
||||||
|
|
||||||
public function __construct(OcRegistryDecorator $registry, CacheInterface $cache)
|
public function __construct(OcRegistryDecorator $registry, CacheInterface $cache, ConnectionInterface $connection)
|
||||||
{
|
{
|
||||||
$this->registry = $registry;
|
$this->registry = $registry;
|
||||||
$this->cache = $cache;
|
$this->cache = $cache;
|
||||||
|
$this->connection = $connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update(array $data): void
|
public function update(array $data): void
|
||||||
{
|
{
|
||||||
$this->registry->model_setting_setting->editSetting('module_telecart', [
|
$this->connection->transaction(function () use ($data) {
|
||||||
'module_telecart_settings' => $data,
|
$this->registry->model_setting_setting->editSetting('module_telecart', [
|
||||||
]);
|
'module_telecart_settings' => $data,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->registry->model_setting_setting->editSetting('module_tgshop', [
|
||||||
|
'module_tgshop_status' => Arr::get($data, 'app.app_enabled', false) ? 1 : 0,
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
$this->cache->clear();
|
$this->cache->clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ npm run build
|
|||||||
|
|
||||||
echo "Move manifest file"
|
echo "Move manifest file"
|
||||||
cp "${SRC_PATH}/module/oc_telegram_shop/upload/image/catalog/tgshopspa/.vite/manifest.json" "${SRC_PATH}/module/oc_telegram_shop/upload/image/catalog/tgshopspa/manifest.json"
|
cp "${SRC_PATH}/module/oc_telegram_shop/upload/image/catalog/tgshopspa/.vite/manifest.json" "${SRC_PATH}/module/oc_telegram_shop/upload/image/catalog/tgshopspa/manifest.json"
|
||||||
|
rm -rf "${SRC_PATH}/module/oc_telegram_shop/upload/image/catalog/tgshopspa/.vite"
|
||||||
|
|
||||||
echo "Build Admin Frontend"
|
echo "Build Admin Frontend"
|
||||||
cd "${SRC_PATH}/frontend/admin"
|
cd "${SRC_PATH}/frontend/admin"
|
||||||
|
|||||||
Reference in New Issue
Block a user