Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jess2772 committed Dec 20, 2023
1 parent 51e36b2 commit 3882715
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const importUserData = () => {
};
});

return seededData
return seededData;
};
// recruitmenttools@uwblueprint.org
// myblueprint!
Expand Down Expand Up @@ -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);

Check failure on line 86 in backend/typescript/migrations/2023.02.18T17.43.41.create-user-table.ts

View workflow job for this annotation

GitHub Actions / run-lint

Replace `.getQueryInterface()` with `⏎····.getQueryInterface()⏎····`
await sequelize.getQueryInterface().bulkInsert(TABLE_NAME, SEEDED_DATA);
};
Expand Down
15 changes: 7 additions & 8 deletions backend/typescript/server.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import fs from "fs";
import cookieParser from "cookie-parser";
import cors from "cors";
import express from "express";
Expand All @@ -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';


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

View workflow job for this annotation

GitHub Actions / run-lint

Delete `⏎⏎`

import IMatchingService from "./services/interfaces/matchingService";
Expand Down Expand Up @@ -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,

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

View workflow job for this annotation

GitHub Actions / run-lint

Expected property shorthand
teams: teams,

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

View workflow job for this annotation

GitHub Actions / run-lint

Expected property shorthand
members: updatedData.updatedMembers,
};
const duplicateUsers = updatedData.duplicateUsers;

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

View workflow job for this annotation

GitHub Actions / run-lint

Use object destructuring

fs.writeFileSync('./graphql/sampleData/members.json', JSON.stringify(updatedMembers));

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

View workflow job for this annotation

GitHub Actions / run-lint

Replace `'./graphql/sampleData/members.json',·JSON.stringify(updatedMembers)` with `⏎····"./graphql/sampleData/members.json",⏎····JSON.stringify(updatedMembers),⏎··`

res.status(200).json({
message: "Successfully added uids for current blueprint members, and resolved duplicates.",

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

View workflow job for this annotation

GitHub Actions / run-lint

Insert `⏎·····`
data: duplicateUsers

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

View workflow job for this annotation

GitHub Actions / run-lint

Insert `,`
Expand Down
13 changes: 0 additions & 13 deletions backend/typescript/services/implementations/matchingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -19,23 +14,15 @@ class MatchingService implements IMatchingService {
/* eslint-disable class-methods-use-this */
async matchApplicationsForRole(role: ApplicantRole): Promise<any> {

Check warning on line 15 in backend/typescript/services/implementations/matchingService.ts

View workflow job for this annotation

GitHub Actions / run-lint

Unexpected any. Specify a different type
const application: Array<ApplicationDTO> | 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,
applications: application
};

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<any> {

Check warning on line 28 in backend/typescript/services/implementations/matchingService.ts

View workflow job for this annotation

GitHub Actions / run-lint

Unexpected any. Specify a different type
Expand Down

0 comments on commit 3882715

Please sign in to comment.