MCPcopy Create free account
hub / github.com/codecombat/codecombat / getOutcomesReportStats

Function getOutcomesReportStats

app/core/api/outcomes-reports.js:3–18  ·  view source on GitHub ↗
(kind, orgIdOrSlug, { includeSubOrgs, country, startDate, endDate, newReport })

Source from the content-addressed store, hash-verified

1import fetchJson from './fetch-json'
2
3export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected