Closed elimisteve closed 6 years ago
The memberships
table already exists, it's just not being populated and used
Next to each pursuance listed at /pursuance/all
, put a blue Join
button to the right.
Once a user clicks Join
, the button should turn purple and say Leave
.
Clicking Join
should trigger a POST
request to /memberships
with a payload that looks like {"user_username": "barrett", "pursuance_id": 5}
(table definition here: https://github.com/PursuanceProject/pursuance/blob/develop/db/sql/table04_memberships.sql)
Clicking Leave
should trigger a DELETE
to /memberships?user_username=eq.${user.username}&pursuance_id=eq.${pursuanceId}
If user.username
in Redux is empty, don't show the Join
/Leave
buttons at all.
Once this is in place we can filter AssignerInput
suggestions based on which users are actually a member of each pursuance, rather than pretending that every user is part of every pursuance! (/cc @Moe-Shoman)
@Moe-Shoman Redux key: ${pursuance_id}_${username}
Users should be able to optionally join or leave a pursuance.
Add this button next to each pursuance listed at
/pursuance/all
.Add an "Explore Pursuance Universe" button on the dashboard somewhere that links to
/pursuance/all
.Later we can make pursuances invite-only, but that's not part of this first version of this feature.