feat(MessageEntriesModal): your can only put lists in BSS that have enabled chat
Build and Push Docker image / build-and-push (push) Successful in 4m42s
Details
Build and Push Docker image / build-and-push (push) Successful in 4m42s
Details
This commit is contained in:
parent
886cf8278e
commit
329b5ba5ff
|
@ -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<EventListModel> & { event?: EventModel }) {
|
||||
export default function ListSelect(props: GenericRecordSearchInputProps<EventListModel> & {
|
||||
event?: EventModel,
|
||||
filter?: string
|
||||
}) {
|
||||
|
||||
const {pb} = usePB()
|
||||
|
||||
|
@ -19,18 +22,22 @@ export default function ListSelect(props: GenericRecordSearchInputProps<EventLis
|
|||
recordSearchMutation={
|
||||
useMutation({
|
||||
mutationFn: async (search: string) => {
|
||||
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
|
||||
}
|
||||
})
|
||||
|
|
|
@ -107,6 +107,7 @@ export default function MessageEntriesModal({opened, event, onClose, query}: {
|
|||
|
||||
<ListSelect
|
||||
event={event}
|
||||
filter={`enableChat=true`}
|
||||
selectedRecords={formValues.values.selectedLists}
|
||||
setSelectedRecords={(ls) => formValues.setFieldValue("selectedLists", ls)}
|
||||
placeholder={"BCC"}
|
||||
|
|
Loading…
Reference in New Issue