This commit is contained in:
Билай Станислав 2024-12-02 16:50:44 +03:00
parent 13978449a2
commit 159b3933fb
2 changed files with 18 additions and 1 deletions

View File

@ -471,6 +471,23 @@ class ModuleService
return false; return false;
} }
public function isShopModule(string $slug): bool
{
if ($this->isServerAvailable()){
$modules_info = RESTClient::request($_ENV['MODULE_SHOP_URL'] . '/api/module_shop/gb_slug');
$modules_info = json_decode($modules_info->getBody()->getContents(), true);
$mod_info = $this->getModuleInfoBySlug($slug);
foreach ($modules_info as $mod) {
if ($mod['slug'] === $mod_info['slug']) {
return true;
}
}
}
return false;
}
public function getKernelModules(): array public function getKernelModules(): array
{ {
$modules_info = []; $modules_info = [];

View File

@ -54,7 +54,7 @@ $table->addAction(function ($row, $url) use ($moduleService) {
}); });
$table->addAction(function ($row, $url) use ($moduleService){ $table->addAction(function ($row, $url) use ($moduleService){
if (!$moduleService->isKernelModule($row['slug'])){ if ($moduleService->isShopModule($row['slug'])){
if (!$moduleService->isLastVersion($row['slug'])) { if (!$moduleService->isLastVersion($row['slug'])) {
$url = "$url/update/?slug=". $row['slug']; $url = "$url/update/?slug=". $row['slug'];