Skip to content

Commit 36eb47e

Browse files
committed
Remove unnecessary csv download and update dependencies
1 parent 0894602 commit 36eb47e

20 files changed

Lines changed: 2821 additions & 2908 deletions

.eslintrc

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
11
{
22
"extends": [],
33
"parser": "@typescript-eslint/parser",
4-
"plugins": [
5-
"@typescript-eslint"
6-
],
4+
"plugins": ["@typescript-eslint"],
75
"settings": {
86
"import/resolver": {
97
"node": {
10-
"extensions": [
11-
".mjs",
12-
".js",
13-
".json",
14-
".ts",
15-
".tsx"
16-
],
17-
"paths": [
18-
"common",
19-
"frontend/src",
20-
"backend/src"
21-
]
8+
"extensions": [".mjs", ".js", ".json", ".ts", ".tsx"],
9+
"paths": ["common", "frontend/src", "backend/src"]
2210
}
2311
}
2412
}
25-
}
13+
}

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ This pull request is the first step towards implementing feature Foo
1818

1919
<!--- List any important or subtle points, future considerations, or other items of note. -->
2020

21-
### Breaking Changes <!-- Optional -->
21+
### Breaking Changes <!-- Optional -->
2222

2323
<!-- Keep items that apply: -->
24+
2425
- Database schema change (anything that changes Firestore collection structure)
25-
- Other change that could cause problems (Detailed in notes)
26+
- Other change that could cause problems (Detailed in notes)

.github/workflows/ci-policies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
- uses: actions/checkout@master
2222
- uses: cornell-dti/big-diff-warning@master
2323
env:
24-
BOT_TOKEN: '${{ secrets.BOT_TOKEN }}'
24+
BOT_TOKEN: '${{ secrets.BOT_TOKEN }}'

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ Helping the Cornell community at-large find reviews and information about housin
1717

1818
You will need Node.js and Yarn installed on your development machine.
1919

20-
To setup your environment, go into the root folder and run `yarn install`. This installs the necessary
21-
dependencies in each required Yarn workspace. Then, run `yarn start` to start a development server
22-
for frontend and backend in parallel. If you specifically want to run either the frontend or backend
23-
on its own, run `yarn frontend-dev` or `yarn backend-dev`.
20+
To setup your environment, go into the root folder and run `yarn install`. This installs the
21+
necessary dependencies in each required Yarn workspace. Then, run `yarn start` to start a
22+
development server for frontend and backend in parallel. If you specifically want to run either the
23+
frontend or backend on its own, run `yarn frontend-dev` or `yarn backend-dev`.
2424

2525
## Contributors
2626

backend/.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
"no-console": "off",
2626
"no-shadow": "off"
2727
}
28-
}
28+
}

backend/src/app.ts

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,10 +2472,6 @@ app.post('/api/admin/run-scraper', authenticate, async (req, res) => {
24722472
),
24732473
];
24742474

2475-
const csvPath = path.join(__dirname, '../scripts/scraper_diff.csv');
2476-
fs.writeFileSync(csvPath, csvLines.join('\n'), 'utf8');
2477-
console.log(`[run-scraper] Diff CSV written to ${csvPath}`);
2478-
24792475
res.status(200).json({
24802476
total: scraped.length,
24812477
newCount,
@@ -2491,40 +2487,6 @@ app.post('/api/admin/run-scraper', authenticate, async (req, res) => {
24912487
}
24922488
});
24932489

2494-
/**
2495-
* Download Scraper Diff CSV - Returns the last scraper_diff.csv written by
2496-
* POST /api/admin/run-scraper.
2497-
*
2498-
* @route GET /api/admin/scraper-results.csv
2499-
*
2500-
* @status
2501-
* - 200: CSV file download
2502-
* - 401: Authentication failed
2503-
* - 403: Unauthorized - Admin access required
2504-
* - 404: No scraper results found — run the scraper first
2505-
* - 500: Server error
2506-
*/
2507-
app.get('/api/admin/scraper-results.csv', authenticate, async (req, res) => {
2508-
if (!req.user) throw new Error('Not authenticated');
2509-
2510-
const { email } = req.user;
2511-
if (!email || !admins.includes(email)) {
2512-
res.status(403).send('Unauthorized: Admin access required');
2513-
return;
2514-
}
2515-
2516-
const csvPath = path.join(__dirname, '../scripts/scraper_diff.csv');
2517-
2518-
if (!fs.existsSync(csvPath)) {
2519-
res.status(404).send('No scraper results found. Run POST /api/admin/run-scraper first.');
2520-
return;
2521-
}
2522-
2523-
res.setHeader('Content-Type', 'text/csv');
2524-
res.setHeader('Content-Disposition', 'attachment; filename="scraper_diff.csv"');
2525-
fs.createReadStream(csvPath).pipe(res);
2526-
});
2527-
25282490
/**
25292491
* Apply Scraper Changes - Takes an array of reviewed/edited diff rows and writes
25302492
* the approved values to the corresponding Firestore building documents.

0 commit comments

Comments
 (0)