Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 0 additions & 81 deletions backend/typescript/models/application.model.ts

This file was deleted.

61 changes: 0 additions & 61 deletions backend/typescript/models/applicationDashboard.model.ts

This file was deleted.

4 changes: 0 additions & 4 deletions backend/typescript/models/user.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
Table,
} from "sequelize-typescript";
import { PositionTitle, PositionTitles, Role } from "../types";
import ApplicationDashboardTable from "./applicationDashboard.model";
import Position from "./position.model";

@Table({ tableName: "users" })
Expand All @@ -35,7 +34,4 @@ export default class User extends Model {
@ForeignKey(() => Position)
@Column({ type: DataType.ENUM(...Object.values(PositionTitles)) })
position?: PositionTitle;

@HasMany(() => ApplicationDashboardTable)
applicationDashboards?: ApplicationDashboardTable[];
}
47 changes: 0 additions & 47 deletions backend/typescript/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import * as admin from "firebase-admin";
import { ApolloServer } from "apollo-server-express";
import { sequelize } from "./models";
import schema from "./graphql";
import Application from "./models/application.model";
import memeberData from "./graphql/sampleData/members.json";
import firebaseAuthUsers from "./graphql/sampleData/users.json";

Expand Down Expand Up @@ -112,52 +111,6 @@ app.get("/authUsers", async (req, res) => {
}
});

app.get("/termApplications", async (req, res) => {
ref
.orderByChild("term")
.equalTo("Fall 2023") // Fetch all applications for <term> (e.g. Fall 2023)
// eslint-disable-next-line func-names
.once("value", function (snapshot) {
const applications: Application[] = [];
snapshot.forEach((childSnapshot) => {
applications.push(childSnapshot.val());
});
res.status(200).json(applications);
});
});

app.get("/applications", async (req, res) => {
try {
const snapshot = await ref.once("value");
const applications: Application[] = [];
snapshot.forEach((childSnapshot) => {
applications.push(childSnapshot.val());
});
res.status(200).json(applications);
} catch (error) {
res
.status(500)
.send("An error occurred while retrieving the applications.");
}
});

app.get("/applications/:id", async (req, res) => {
try {
const { id } = req.params;
const snapshot = await ref.child(id).once("value");
const application = snapshot.val();
if (application) {
res.status(200).json(application);
} else {
res.status(404).send("Student application not found.");
}
} catch (error) {
res
.status(500)
.send("An error occurred while retrieving the student application.");
}
});

Comment on lines -115 to -160
Copy link
Contributor Author

@mxc-maggiechen mxc-maggiechen Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are calls to firebase to grab applicant information left from the previous team. However, it seems like we haven't been using these calls and instead have been relying on hardcoded sample data in backend/typescript/migrations/processedApplicants.json. We are deleting these calls for now because they are using legacy models, but we will be wrapping these firebase calls in a service function in the future with models from our new database schema.

app.listen({ port: process.env.PORT || 5000 }, () => {
// eslint-disable-next-line no-console
console.info(`Server is listening on port ${process.env.PORT || 5000}!`);
Expand Down
Loading