Number of people who have bookmarked an establishment

Have a read of the below - very similar use case as yours…

What you will probably need to do is implement your own “Like” function, with 2 columns in your Establishments table:

  • A user specific boolean column to hold each users “Like”
  • A number column to use as a global counter for the number of likes for each establishment

You’ll need to use a component that you can attach an action to (similar to how I described in the above), and when a user “Likes” an establishment, your action should do two things:

  • Set the user specific column to true
  • Increment the counter by 1

You might want to implement additional logic to prevent users from “liking” an establishment multiple times and blowing out the counter.