Skip to content

Commit

Permalink
adds pumsLatestYear to naics and soc customAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
davelandry committed Jun 23, 2023
1 parent fc7e2f9 commit cf09bf1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/customAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,15 @@ module.exports = function(app) {
retObj.beaL0 = beaIds && beaIds.L0 ? beaIds.L0 : false;
retObj.beaL1 = beaIds && beaIds.L1 ? beaIds.L1 : false;
retObj.blsIds = blsInds[id] || false;
retObj.pumsLatestYear = await axios.get(`${origin}/api/data?${hierarchy}=${id}&measures=Total%20Population&limit=1&order=Year&sort=desc`)
.then(resp => resp.data.data[0]["ID Year"])
.catch(() => 2020);
}
else if (dimension === "PUMS Occupation") {
retObj.blsIds = blsOccs[id] || false;
retObj.pumsLatestYear = await axios.get(`${origin}/api/data?${hierarchy}=${id}&measures=Total%20Population&limit=1&order=Year&sort=desc`)
.then(resp => resp.data.data[0]["ID Year"])
.catch(() => 2020);
}
else if (dimension === "CIP") {
retObj.stem = id.length === 6 ? stems.includes(id) ? "Stem Major" : false : "Contains Stem Majors"
Expand Down

0 comments on commit cf09bf1

Please sign in to comment.