Skip to content

Commit 3ffa1f3

Browse files
authored
Merge pull request #2082 from hackforla/ssiegal.remove-last-2025s
Parameterize year in socrata call; add local debug instructions to README
2 parents 3ac1c41 + 2f7dd55 commit 3ffa1f3

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,25 @@ Our mission is to create a user-friendly platform for anyone interested in explo
6565
- Run `npm start`
6666
- Visit http://localhost:5173
6767

68+
### Debug locally using VSCode
69+
70+
Your launch.json config should look something like this:
71+
72+
```bash
73+
"type": "chrome",
74+
"request": "launch",
75+
"name": "Debug in Chrome",
76+
"url": "http://localhost:5173",
77+
"webRoot": "${workspaceFolder}",
78+
"sourceMapPathOverrides": {
79+
"/@fs/*": "/*",
80+
"/src/*": "${workspaceFolder}/src/*"
81+
},
82+
```
83+
84+
- Run `npm start` in a terminal
85+
- Press F5 to start "Debug in Chrome". VSCode will open a Chrome window it controls. You can set breakpoints etc in VSCode.
86+
6887
### Run tests
6988

7089
- Run `npm test`

src/utils/DataService.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import moment from "moment";
44
import ddbh from "@utils/duckDbHelpers.js";
55

66
const dataResources = {
7+
2026: "2cy6-i7zn",
78
2025: "h73f-gn57",
89
2024: "b7dx-7gc3",
910
2019: "pvft-t768",
@@ -63,9 +64,11 @@ export async function getServiceRequestSocrata() {
6364
const dataLoadStartTime = performance.now();
6465

6566
try {
66-
// Fetch 2025 SR data through Socrata API
67+
// Fetch current year SR data through Socrata API
68+
const currentYear = String(new Date().getFullYear());
69+
const currentYearFilename = `https://data.lacity.org/resource/${dataResources[currentYear]}.json`
6770
const response = await fetch(
68-
"https://data.lacity.org/resource/h73f-gn57.json"
71+
currentYearFilename
6972
);
7073
const unvalidatedSrs = await response.json();
7174

0 commit comments

Comments
 (0)