Skip to content

Commit

Permalink
adds termApplications route for recent data
Browse files Browse the repository at this point in the history
  • Loading branch information
HeetShah committed Oct 19, 2023
1 parent f39737d commit 8e45bb9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions backend/typescript/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { sequelize } from "./models";
import schema from "./graphql";
import Application from "./models/application.model";


Check failure on line 10 in backend/typescript/server.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `⏎`
const CORS_ALLOW_LIST = [
"http://localhost:3000",
"https://uw-blueprint-starter-code.firebaseapp.com",
Expand Down Expand Up @@ -62,6 +63,17 @@ admin.initializeApp({
});
const db = admin.database();
const ref = db.ref("studentApplications");


Check failure on line 67 in backend/typescript/server.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `⏎`
app.get("/termApplications", async (req, res) => {
ref.orderByChild("term").equalTo("Fall 2023").once("value", function (snapshot) {

Check failure on line 69 in backend/typescript/server.ts

View workflow job for this annotation

GitHub Actions / run-lint

Replace `.orderByChild("term").equalTo("Fall·2023")` with `⏎····.orderByChild("term")⏎····.equalTo("Fall·2023")⏎····`

Check warning on line 69 in backend/typescript/server.ts

View workflow job for this annotation

GitHub Actions / run-lint

Unexpected unnamed function
const applications: Application[] = [];

Check failure on line 70 in backend/typescript/server.ts

View workflow job for this annotation

GitHub Actions / run-lint

Insert `··`
snapshot.forEach((childSnapshot) => {

Check failure on line 71 in backend/typescript/server.ts

View workflow job for this annotation

GitHub Actions / run-lint

Insert `··`
applications.push(childSnapshot.val());

Check failure on line 72 in backend/typescript/server.ts

View workflow job for this annotation

GitHub Actions / run-lint

Insert `··`
});

Check failure on line 73 in backend/typescript/server.ts

View workflow job for this annotation

GitHub Actions / run-lint

Insert `··`
res.status(200).json(applications);

Check failure on line 74 in backend/typescript/server.ts

View workflow job for this annotation

GitHub Actions / run-lint

Insert `··`
})});

Check failure on line 75 in backend/typescript/server.ts

View workflow job for this annotation

GitHub Actions / run-lint

Replace `})` with `··});⏎`

Check failure on line 76 in backend/typescript/server.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `··`
app.get("/applications", async (req, res) => {
try {
const snapshot = await ref.once("value");
Expand Down

0 comments on commit 8e45bb9

Please sign in to comment.