From 38827157f9e698b280abea0d7d21e6423773202d Mon Sep 17 00:00:00 2001 From: Jesse Li Date: Wed, 20 Dec 2023 15:04:29 -0500 Subject: [PATCH] fix lint errors --- .../2023.02.18T17.43.41.create-user-table.ts | 5 ++--- backend/typescript/server.ts | 15 +++++++-------- .../services/implementations/matchingService.ts | 13 ------------- 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/backend/typescript/migrations/2023.02.18T17.43.41.create-user-table.ts b/backend/typescript/migrations/2023.02.18T17.43.41.create-user-table.ts index 13bab39..f2b8b45 100644 --- a/backend/typescript/migrations/2023.02.18T17.43.41.create-user-table.ts +++ b/backend/typescript/migrations/2023.02.18T17.43.41.create-user-table.ts @@ -44,7 +44,7 @@ const importUserData = () => { }; }); - return seededData + return seededData; }; // recruitmenttools@uwblueprint.org // myblueprint! @@ -82,8 +82,7 @@ export const up: Migration = async ({ context: sequelize }) => { updatedAt: DataType.DATE, }); - const SEEDED_DATA = importUserData() - + const SEEDED_DATA = importUserData(); await sequelize.getQueryInterface().bulkInsert(TABLE_NAME, ORIGINAL_SEEDED_DATA); await sequelize.getQueryInterface().bulkInsert(TABLE_NAME, SEEDED_DATA); }; diff --git a/backend/typescript/server.ts b/backend/typescript/server.ts index eaa9e9d..a281ac7 100644 --- a/backend/typescript/server.ts +++ b/backend/typescript/server.ts @@ -1,3 +1,4 @@ +import fs from "fs"; import cookieParser from "cookie-parser"; import cors from "cors"; import express from "express"; @@ -9,7 +10,7 @@ import Application from "./models/application.model"; import memberData from "./graphql/sampleData/members.json"; import firebaseAuthUsers from "./graphql/sampleData/users.json"; import { ApplicantRole } from "./types"; -import fs from 'fs'; + import IMatchingService from "./services/interfaces/matchingService"; @@ -120,19 +121,17 @@ app.get("/authUsers", async (req, res) => { } }); - app.get("/addMemberUids", async (req, res) => { - const term = memberData.term; + const { term, teams } = memberData; const updatedData = await matchingService.linkMemberUids(term); const updatedMembers = { - term: memberData.term, - teams: memberData.teams, - members: updatedData.updatedMembers - } + term: term, + teams: teams, + members: updatedData.updatedMembers, + }; const duplicateUsers = updatedData.duplicateUsers; fs.writeFileSync('./graphql/sampleData/members.json', JSON.stringify(updatedMembers)); - res.status(200).json({ message: "Successfully added uids for current blueprint members, and resolved duplicates.", data: duplicateUsers diff --git a/backend/typescript/services/implementations/matchingService.ts b/backend/typescript/services/implementations/matchingService.ts index 88322a3..3fc384b 100644 --- a/backend/typescript/services/implementations/matchingService.ts +++ b/backend/typescript/services/implementations/matchingService.ts @@ -4,12 +4,7 @@ import { } from "../../types"; import * as admin from "firebase-admin"; import memberData from "../../graphql/sampleData/members.json"; - - -import User from "../../models/user.model"; import IMatchingService from "../interfaces/matchingService"; -import ApplicationDashboardTable from "../../models/applicationDashboard.model"; - import IAppDashboardService from "../interfaces/appDashboardService"; import AppDashboardService from "./appDashboardService"; @@ -19,11 +14,8 @@ class MatchingService implements IMatchingService { /* eslint-disable class-methods-use-this */ async matchApplicationsForRole(role: ApplicantRole): Promise { const application: Array | null = await appDashboardService.getApplicationsByRole(role); - // const roles = Object.values(ApplicantRole); const term = memberData.term; const roleMembers = memberData.members.filter((member) => member.term === term && member.role === role); - // For each role, just do it here no? - // how do i read from the applicantresponse database? const memberRoleBreakdown = { role, members: roleMembers, @@ -31,11 +23,6 @@ class MatchingService implements IMatchingService { }; return memberRoleBreakdown; - - // For each of the roles, I need to get the applications for that role. - // Then I need to get the members for that role. - // Then I need to match them, and assign two members to each application. - // Then I need to save the assignments to the database, so each applicaiton will have two entries in the db, one for each reviewer. } async linkMemberUids(term: number): Promise {