Skip to content

Instantly share code, notes, and snippets.

@DTwigs
Last active September 29, 2016 18:28
Show Gist options
  • Save DTwigs/c5352ae8467f4f0d9f02f534ff98b3d3 to your computer and use it in GitHub Desktop.
Save DTwigs/c5352ae8467f4f0d9f02f534ff98b3d3 to your computer and use it in GitHub Desktop.
Leads Reducer Actions and APi Calls
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