forked from tsai/budibase
Browse Source
Changes as per PR -Created files for transformer queries - tests updated accordingly -Updates for Env variables and usage -Changes surrounding App Rename testingmaster
9 changed files with 134 additions and 103 deletions
@ -1,9 +1,11 @@ |
|||
{ |
|||
"baseUrl": "http://localhost:10001/builder/", |
|||
"baseUrl": "http://localhost:10001", |
|||
"video": true, |
|||
"projectId": "bmbemn", |
|||
"env": { |
|||
"PORT": "10001", |
|||
"JWT_SECRET": "test" |
|||
"JWT_SECRET": "test", |
|||
"HOST_IP": "", |
|||
"TEST_ENV" : true |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,11 @@ |
|||
const breweries = data |
|||
const totals = {} |
|||
|
|||
for (let brewery of breweries) |
|||
{const state = brewery.state |
|||
if (totals[state] == null) |
|||
{totals[state] = 1} |
|||
else |
|||
{totals[state]++}} |
|||
const entries = Object.entries(totals) |
|||
return entries.map(([state, count]) => ({state, count})) |
|||
@ -0,0 +1,27 @@ |
|||
const breweries = data |
|||
const totals = {} |
|||
for (let brewery of breweries) |
|||
{const state = brewery.state |
|||
if (totals[state] == null) |
|||
{totals[state] = 1 |
|||
} else |
|||
{totals[state]++ |
|||
}} |
|||
const stateCodes = |
|||
{"texas":"tx", |
|||
"colorado":"co", |
|||
"florida":"fl", |
|||
"iwoa":"ia", |
|||
"louisiana":"la", |
|||
"california":"ca", |
|||
"pennsylvania":"pa", |
|||
"georgia":"ga", |
|||
"new hampshire":"nh", |
|||
"virginia":"va", |
|||
"michigan":"mi", |
|||
"maryland":"md", |
|||
"ohio":"oh"} |
|||
const entries = Object.entries(totals) |
|||
return entries.map(([state, count]) => |
|||
{const stateCode = stateCodes[state.toLowerCase()] |
|||
return {state, count, flag: 'http://flags.ox3.in/svg/us/${stateCode}.svg'}}) |
|||
Loading…
Reference in new issue