chandler37 / givegivegave

charity database
Apache License 2.0
1 stars 2 forks source link

Causes e.g. /Health/Disease #59

Open chandler37 opened 6 years ago

chandler37 commented 6 years ago

we need a hierarchical causes database so you can

POST /api/v1/causes {cause: {name: "Health"}} receiving {id: "1"...}

and subsequently

POST /api/v1/causes {cause: {name: "Disease Amelioration", parent_id: "1"}} receiving {id: "2"...}

and then

PATCH /api/v1/charities/1 {charity: {cause_id: "2"}}

or perhaps instead

POST /api/v1/charities/1/causes to append a cause without wiping out existing causes?

and then

GET /api/v1/causes/2?page=1&per_page=10 receiving {child_causes: [], charities: [{id: "1"...

A charity can have more than one leaf cause, let's say both /Health/Disease and /Education/Children, 4 causes total.

GET /api/v1/causes?depth=1 will yield only /Health and /Education

chandler37 commented 6 years ago

60 does 85% of the above.