I am stuck with a problem. I would like to allow some users to “follow” other users, like in Medium.com when a reader follows an author to get notified of the author’s new articles. The problem I have is simple: how to do that with an Action Button in Tadabase? Or is there another way?
First, assuming this is with an action button, I don’t know how to test a condition that is based on a logged in user field. Here the condition would be: if the user already follows the author (i.e. is connected), then the text of the button should be replaced by “Following” and the action (create a connection) should be disabled.
Assuming the connections are modeled with a “Connections” table with 2 fields: a connection to the authors table, a connection to the readers table, then “following” means adding a record to the table (author’s page user + logged in user). The problem is the “unfollowing” part.
How to delete a connection with a simple click of an action button, without having to display a table with ALL the connections?
How to allow a single connection (and no duplicate connections) between two users?