diff --git a/controllers/contactPersonController.js b/controllers/contactPersonController.js index 4502d08..7d86ae9 100644 --- a/controllers/contactPersonController.js +++ b/controllers/contactPersonController.js @@ -77,25 +77,25 @@ const filterContactPersons = async (req, res) => { console.log(configString, typeof configString); const config = JSON.parse(configString); const where = {}; + const having = []; console.log(config, typeof config); console.log(config.selection); if (config.selection.id && config.selection.id === 'all') { + // No additional filter needed for "all" } else if (config.selection.id) { where.id = config.selection.id; } else { - const filters = []; - if (config.selection.types && config.selection.types.length > 0) { - filters.push({ '$positions.id$': { [Op.in]: config.selection.types } }); + having.push({ '$positions.id$': { [Op.in]: config.selection.types } }); } if (config.selection.places && config.selection.places.length > 0) { - filters.push({ '$events.eventPlaceId$': { [Op.in]: config.selection.places } }); + having.push({ '$events.eventPlaceId$': { [Op.in]: config.selection.places } }); } - if (filters.length > 0) { - where[Op.and] = filters; + if (config.selection.positions && config.selection.positions.length > 0) { + having.push({ '$positions.id$': { [Op.in]: config.selection.positions } }); } } @@ -106,13 +106,16 @@ const filterContactPersons = async (req, res) => { model: Position, as: 'positions', through: { attributes: [] }, + required: true, // Ensure only contact persons with matching positions are included }, { model: Event, as: 'events', through: { attributes: [] }, + required: false, }, ], + having: having.length > 0 ? { [Op.and]: having } : undefined, }); res.json(contactPersons); diff --git a/public/images/uploads/3cb841cb-6764-4c27-b745-62efb91adb06.jpg b/public/images/uploads/3cb841cb-6764-4c27-b745-62efb91adb06.jpg new file mode 100644 index 0000000..af35d62 Binary files /dev/null and b/public/images/uploads/3cb841cb-6764-4c27-b745-62efb91adb06.jpg differ diff --git a/public/images/uploads/59b29477-6997-4d3c-9010-54ba7c0a7ba3.jpg b/public/images/uploads/59b29477-6997-4d3c-9010-54ba7c0a7ba3.jpg new file mode 100644 index 0000000..b342401 Binary files /dev/null and b/public/images/uploads/59b29477-6997-4d3c-9010-54ba7c0a7ba3.jpg differ diff --git a/src/components/AddContactDialog.vue b/src/components/AddContactDialog.vue index 1d672be..eca7d68 100644 --- a/src/components/AddContactDialog.vue +++ b/src/components/AddContactDialog.vue @@ -19,8 +19,8 @@ label="caption" track-by="id" />
- - Wählen Sie eine Position: +
@@ -41,8 +41,7 @@
@@ -129,12 +128,13 @@ export default { selectedContact.value = null; } else if (selectedTypes.value.some(type => type.id === 'types')) { selectedContact.value = null; - } else if (selectedPositions.value.some(type => type.id === 'position')) { + } else if (selectedTypes.value.some(type => type.id === 'position')) { selectedContact.value = null; } }; const confirmAddContactConfiguration = () => { + console.log('Selected positions:', selectedPositions.value); // Log the selected positions let configString = ''; const displayArray = Object.keys(displayOptions.value).filter((key) => displayOptions.value[key]); let selection = {}; @@ -145,7 +145,7 @@ export default { } else { selection['types'] = selectedEventTypes.value.map((type) => type.id); selection['places'] = selectedPlaces.value.map((place) => place.id); - selection['positions'] = selectedPositions.value((postion) => postion.id); + selection['positions'] = Array.isArray(selectedPositions.value) ? selectedPositions.value.map((position) => position.id) : []; } const contact = { selection: selection, @@ -153,6 +153,7 @@ export default { style: displayStyle.value } configString = '{{ contact:' + JSON.stringify(contact) + ' }}'; + console.log('Emitting config:', configString); // Log the emitted config emit('confirm', configString); closeAddContactDialog(); }; @@ -243,4 +244,4 @@ export default { .display-options label { display: block; } - \ No newline at end of file + diff --git a/src/components/ContactRender.vue b/src/components/ContactRender.vue index 7ae5cdf..03e7f68 100644 --- a/src/components/ContactRender.vue +++ b/src/components/ContactRender.vue @@ -1,7 +1,7 @@ + + + + + \ No newline at end of file diff --git a/src/content/music/MiriamkantoreiContent.vue b/src/content/music/MiriamkantoreiContent.vue new file mode 100644 index 0000000..30c76ae --- /dev/null +++ b/src/content/music/MiriamkantoreiContent.vue @@ -0,0 +1,25 @@ + + + + + + \ No newline at end of file diff --git a/src/content/music/VocalEnsembleContent.vue b/src/content/music/VocalEnsembleContent.vue new file mode 100644 index 0000000..a6ddb6c --- /dev/null +++ b/src/content/music/VocalEnsembleContent.vue @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file