(kind, orgIdOrSlug, { includeSubOrgs, country, startDate, endDate, newReport })
| 1 | import fetchJson from './fetch-json' |
| 2 | |
| 3 | export const getOutcomesReportStats = (kind, orgIdOrSlug, { includeSubOrgs, country, startDate, endDate, newReport }) => { |
| 4 | let url = `/db/outcomes-reports/${kind}/${orgIdOrSlug}/stats?includeSubOrgs=${includeSubOrgs || false}` |
| 5 | if (newReport) { |
| 6 | url += '&new_report=true' |
| 7 | } |
| 8 | if (kind === 'administrative-region') { |
| 9 | url += `&country=${country || 'US'}` |
| 10 | } |
| 11 | if (startDate) { |
| 12 | url += `&startDate=${startDate}` |
| 13 | } |
| 14 | if (endDate && endDate !== moment(new Date()).format('YYYY-MM-DD')) { |
| 15 | url += `&endDate=${endDate}` |
| 16 | } |
| 17 | return fetchJson(url) |
| 18 | } |
nothing calls this directly
no outgoing calls
no test coverage detected