Hi Eitan,
I'm working on a Wix database where users can filter search results displayed in a repeater (#repeater1) using a button (called #applyFilters). What I want to implement is a restriction where each user can only click the #applyFilters button 10 times per month, after which they can no longer trigger new searches until the 1st of the next month, when the counter resets automatically.
Ideally, I’d like this logic to:
Count and store how many times a logged-in user triggers the #applyFilters button;
Prevent further searches once they hit the 10-search limit (by hiding/not showing of the results in #repeater1);
Automatically reset the counter for all users on the 1st of each month;
Trigger my #errorMessage element to display a warning when the user hits the limit;
Display the remaining number of monthly searches (#countDown) to the user (e.g., “3 searches left this month”).
I’ve got the database and repeater setup working fine, but I’m unsure how to structure this kind of logic with Wix Data and Velo. Could you help me with the code or suggest the best way to implement this?
Thanks in advance for your time and help!
Best regards, Daan