Last active
September 29, 2016 18:28
-
-
Save DTwigs/c5352ae8467f4f0d9f02f534ff98b3d3 to your computer and use it in GitHub Desktop.
Leads Reducer Actions and APi Calls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Leads Actions: | |
populateLeadsSaga = (Triggered by location change) | |
GetLeads (URL: /leads/?location=:location_id) | |
if (lead_id exists in url && lead_id in index) | |
open modal | |
else if (lead id exists in url) | |
GetLead (URL: /leads/:lead_id) | |
.success(open modal) | |
.fail(unauthorized) | |
------------ | |
ClearLeads (triggered by componentDidUnmount?) | |
------------ | |
URL: /lead/:id/update_status | |
Accept (patch) = | |
API payload: { Id, status(string) } | |
user is implied by the session | |
API Response: The updated lead | |
Decline (patch) = | |
API payload: { Id, status(string) } | |
user is implied by the session | |
API Response: The updated lead | |
------------- | |
URL: /lead/:id/archive | |
Archive (patch) = | |
API payload: { Id, archived(boolean) } | |
API Response: The updated lead | |
-------------- | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment