Small bugfix regarding groupEdits

This commit is contained in:
Andreas Palm 2024-03-15 22:22:27 +01:00
parent eca32e6d6e
commit f442555156
4 changed files with 12 additions and 4 deletions

View File

@ -127,6 +127,8 @@ final class MatrixProductGateway
} }
public function GetArticleOptionIdsByGroupIds(int|array $groupIds) : array { public function GetArticleOptionIdsByGroupIds(int|array $groupIds) : array {
if (empty($groupIds))
return [];
$sql = "SELECT id FROM matrixprodukt_eigenschaftenoptionen WHERE gruppe IN (:ids)"; $sql = "SELECT id FROM matrixprodukt_eigenschaftenoptionen WHERE gruppe IN (:ids)";
return $this->db->fetchCol($sql, ['ids' => $groupIds]); return $this->db->fetchCol($sql, ['ids' => $groupIds]);
} }
@ -267,6 +269,8 @@ final class MatrixProductGateway
public function GetVariantIdsByOptions(int|array $optionIds) : array public function GetVariantIdsByOptions(int|array $optionIds) : array
{ {
if (empty($optionIds))
return [];
$sql = "SELECT artikel FROM matrixprodukt_optionen_zu_artikel WHERE option_id IN (:ids)"; $sql = "SELECT artikel FROM matrixprodukt_optionen_zu_artikel WHERE option_id IN (:ids)";
return $this->db->fetchCol($sql, ['ids' => $optionIds]); return $this->db->fetchCol($sql, ['ids' => $optionIds]);
} }

View File

@ -60,6 +60,10 @@ function onSave() {
onClose(); onClose();
} }
function onGroupSave() {
location.reload();
}
function onClose() { function onClose() {
model.value = null; model.value = null;
} }
@ -67,8 +71,8 @@ function onClose() {
<template> <template>
<template v-if="model"> <template v-if="model">
<AddGlobalToArticle v-if="model.action === 'addGlobalToArticle'" v-bind="model" @close="onClose" @save="onSave" /> <AddGlobalToArticle v-if="model.action === 'addGlobalToArticle'" v-bind="model" @close="onClose" @save="onGroupSave" />
<GroupEdit v-else-if="model.action === 'groupEdit'" v-bind="model" @close="onClose" @save="onSave" /> <GroupEdit v-else-if="model.action === 'groupEdit'" v-bind="model" @close="onClose" @save="onGroupSave" />
<OptionEdit v-else-if="model.action === 'optionEdit'" v-bind="model" @close="onClose" @save="onSave" /> <OptionEdit v-else-if="model.action === 'optionEdit'" v-bind="model" @close="onClose" @save="onSave" />
<Variant v-else-if="model.action === 'variantEdit'" v-bind="model" @close="onClose" @save="onSave" /> <Variant v-else-if="model.action === 'variantEdit'" v-bind="model" @close="onClose" @save="onSave" />
<Translation v-else-if="model.action === 'translationEdit'" v-bind="model" @close="onClose" @save="onSave" /> <Translation v-else-if="model.action === 'translationEdit'" v-bind="model" @close="onClose" @save="onSave" />

View File

@ -7,7 +7,7 @@
"css": [ "css": [
"assets/entry-597722a1.css" "assets/entry-597722a1.css"
], ],
"file": "assets/modules/MatrixProduct-e3c4dfba.js", "file": "assets/modules/MatrixProduct-8ac5c604.js",
"isEntry": true, "isEntry": true,
"src": "classes/Modules/MatrixProduct/www/js/entry.jsx" "src": "classes/Modules/MatrixProduct/www/js/entry.jsx"
} }