diff --git a/src/pages/events/e/:eventId/EventLists/ListSelect.tsx b/src/pages/events/e/:eventId/EventLists/ListSelect.tsx index 7b609e8..a024d26 100644 --- a/src/pages/events/e/:eventId/EventLists/ListSelect.tsx +++ b/src/pages/events/e/:eventId/EventLists/ListSelect.tsx @@ -5,7 +5,10 @@ import {EventListModel, EventModel} from "@/models/EventTypes.ts"; import RecordSearchInput, {GenericRecordSearchInputProps} from "@/components/input/RecordSearchInput.tsx"; -export default function ListSelect(props: GenericRecordSearchInputProps & { event?: EventModel }) { +export default function ListSelect(props: GenericRecordSearchInputProps & { + event?: EventModel, + filter?: string +}) { const {pb} = usePB() @@ -19,18 +22,22 @@ export default function ListSelect(props: GenericRecordSearchInputProps { - const filter: string[] = [] + const f: string[] = [] if (search) { - filter.push(`name ~ "${search}"`) + f.push(`name ~ "${search}"`) } if (props.event) { - filter.push(`event='${props.event.id}'`) + f.push(`event='${props.event.id}'`) + } + + if (props.filter) { + f.push(props.filter) } return (await pb.collection('eventLists').getList(1, 5, { - filter: filter.join(" && "), + filter: f.join(" && "), })).items } }) diff --git a/src/pages/events/e/:eventId/EventLists/Search/MessageEntriesModal.tsx b/src/pages/events/e/:eventId/EventLists/Search/MessageEntriesModal.tsx index 004da76..7d19e2e 100644 --- a/src/pages/events/e/:eventId/EventLists/Search/MessageEntriesModal.tsx +++ b/src/pages/events/e/:eventId/EventLists/Search/MessageEntriesModal.tsx @@ -107,6 +107,7 @@ export default function MessageEntriesModal({opened, event, onClose, query}: { formValues.setFieldValue("selectedLists", ls)} placeholder={"BCC"}