Step 3. Upvoting Features
Step duration ~18 min
Last updated
Step duration ~18 min
Last updated
To set up user management, follow these steps:
Create an API endpoint on the "App users" (WebUser) data structure with a condition like "role like admin" on the user's session
Create a new web page with a security condition where "role == admin"
Add a Table component to that page.
Let's add two new fields to Features
data structure:
Upvotes ("Number")
Users Upvoted IDs ("ArrayLink → WebUser").
Next, create a new page for upvoting, which should be accessible to all authorized users:
Note that we've added the "Upvotes" field as a counter on the cards.
Now, we configure actions:
Add a new data structure upvotes
with the following fields:
user_id
, type of link→WebUser
feature_id
, type of link→Features
Create an API endpoint for adding objects to upvotes
Design a scenario for counting votes (avoiding duplication).
Finally, we are sorting the cards by upvotes
.