Hi! I’m building a react app that utilizes react-instantsearch to search an index of user uploaded contacts. I’d like to allow the user to filter / search down to a subset of the entire contacts index and then send a message to all contacts that meet the current search parameters
My (perhaps naive) plan to is:
- Allow user to search. Keep track of current search with
- When user has filtered the records to their specifications, they can click on a button which triggers a modal where they provide the message content (among other things).
- When the user hits “send” it dispatches an api call to the backend with all the message parameters along with the search parameters derived from
- The backend then uses that searchState information to query my indexes again, grab all necessary data from the records and dispatch the message.
Question: Is this the right approach? Are there any pitfalls / concerns I should be aware of as I implement this? Any better ways to deal with a subset of records? Unfortunately I don’t think I can take a “shopping cart” approach and allow users to select individual records for message sends because in some cases they may want to send messages to thousands of contacts and needing to select each individually would be too much. Thoughts?