Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a search filter to the participant search popover and items per page #4064

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,29 @@ useHotKey([props.hotkey], () => {
const emit = defineEmits(["participant-selected"])

// Fetch priorities
const fetchParticipants = async () => {
const fetchParticipants = async (query = "") => {
try {
const options = { itemsPerPage: -1 }
const options = {
filter: JSON.stringify([
{ and: [{ model: "IndividualContact", field: "name", op: "like", value: `%${query}%` }] },
]),
itemsPerPage: 10,
}
const response = await IndividualApi.getAll(options)
participants.value = response.data.items.map((item: any) => item.name)
} catch (error) {
console.error("Error fetching participants:", error)
}
}

watch(
searchQuery,
async (newValue: string) => {
await fetchParticipants(newValue)
},
{ immediate: true }
)

onMounted(() => {
fetchParticipants()
})
Expand Down
Loading