Skip to content

Commit ac4a0c6

Browse files
author
Maggie Chen
committed
drop legacy models
1 parent 59ccbc6 commit ac4a0c6

File tree

4 files changed

+0
-192
lines changed

4 files changed

+0
-192
lines changed

backend/typescript/models/application.model.ts

Lines changed: 0 additions & 81 deletions
This file was deleted.

backend/typescript/models/applicationDashboard.model.ts

Lines changed: 0 additions & 61 deletions
This file was deleted.

backend/typescript/models/user.model.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
Table,
1010
} from "sequelize-typescript";
1111
import { PositionTitle, PositionTitles, Role } from "../types";
12-
import ApplicationDashboardTable from "./applicationDashboard.model";
1312
import Position from "./position.model";
1413

1514
@Table({ tableName: "users" })
@@ -36,6 +35,4 @@ export default class User extends Model {
3635
@Column({ type: DataType.ENUM(...Object.values(PositionTitles)) })
3736
position?: PositionTitle;
3837

39-
@HasMany(() => ApplicationDashboardTable)
40-
applicationDashboards?: ApplicationDashboardTable[];
4138
}

backend/typescript/server.ts

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import * as admin from "firebase-admin";
55
import { ApolloServer } from "apollo-server-express";
66
import { sequelize } from "./models";
77
import schema from "./graphql";
8-
import Application from "./models/application.model";
98
import memeberData from "./graphql/sampleData/members.json";
109
import firebaseAuthUsers from "./graphql/sampleData/users.json";
1110

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

115-
app.get("/termApplications", async (req, res) => {
116-
ref
117-
.orderByChild("term")
118-
.equalTo("Fall 2023") // Fetch all applications for <term> (e.g. Fall 2023)
119-
// eslint-disable-next-line func-names
120-
.once("value", function (snapshot) {
121-
const applications: Application[] = [];
122-
snapshot.forEach((childSnapshot) => {
123-
applications.push(childSnapshot.val());
124-
});
125-
res.status(200).json(applications);
126-
});
127-
});
128-
129-
app.get("/applications", async (req, res) => {
130-
try {
131-
const snapshot = await ref.once("value");
132-
const applications: Application[] = [];
133-
snapshot.forEach((childSnapshot) => {
134-
applications.push(childSnapshot.val());
135-
});
136-
res.status(200).json(applications);
137-
} catch (error) {
138-
res
139-
.status(500)
140-
.send("An error occurred while retrieving the applications.");
141-
}
142-
});
143-
144-
app.get("/applications/:id", async (req, res) => {
145-
try {
146-
const { id } = req.params;
147-
const snapshot = await ref.child(id).once("value");
148-
const application = snapshot.val();
149-
if (application) {
150-
res.status(200).json(application);
151-
} else {
152-
res.status(404).send("Student application not found.");
153-
}
154-
} catch (error) {
155-
res
156-
.status(500)
157-
.send("An error occurred while retrieving the student application.");
158-
}
159-
});
160-
161114
app.listen({ port: process.env.PORT || 5000 }, () => {
162115
// eslint-disable-next-line no-console
163116
console.info(`Server is listening on port ${process.env.PORT || 5000}!`);

0 commit comments

Comments
 (0)