Skip to content

Commit

Permalink
Fix imports and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ji-mmyliu committed Sep 24, 2024
1 parent e85ec05 commit 7ddb407
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
7 changes: 5 additions & 2 deletions backend/services/implementations/userService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const getMongoUserByAuthId = async (authId: string): Promise<User> => {

class UserService implements IUserService {
/* eslint-disable class-methods-use-this */
async getUserById(userId: string): Promise<UserDTO> {
async getUserById(userId: string | ObjectId): Promise<UserDTO> {
let user: User | null;
let firebaseUser: firebaseAdmin.auth.UserRecord;

Expand Down Expand Up @@ -184,7 +184,10 @@ class UserService implements IUserService {
};
}

async updateUserById(userId: string, user: UpdateUserDTO): Promise<UserDTO> {
async updateUserById(
userId: ObjectId | string,
user: UpdateUserDTO,
): Promise<UserDTO> {
let oldUser: User | null;
let updatedFirebaseUser: firebaseAdmin.auth.UserRecord;

Expand Down
6 changes: 6 additions & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ const App = (): React.ReactElement => {
path={Routes.NOT_AUTHORIZED_PAGE}
component={NotAuthorized}
/>
<PrivateRoute
exact
path={Routes.CREATE_PASSWORD_PAGE}
component={CreatePasswordPage}
allowedRoles={["Administrator", "Learner"]}
/>
<PrivateRoute
exact
path={Routes.MANAGE_USERS_PAGE}
Expand Down
7 changes: 1 addition & 6 deletions frontend/src/components/auth/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import React, { useContext, useState } from "react";
import { Redirect, useHistory, useLocation } from "react-router-dom";
import authAPIClient from "../../APIClients/AuthAPIClient";
import {
CREATE_PASSWORD_PAGE,
HOME_PAGE,
SIGNUP_PAGE,
WELCOME_PAGE,
} from "../../constants/Routes";
import { HOME_PAGE, SIGNUP_PAGE, WELCOME_PAGE } from "../../constants/Routes";
import AuthContext from "../../contexts/AuthContext";
import { AuthenticatedUser } from "../../types/AuthTypes";
import AUTHENTICATED_USER_KEY from "../../constants/AuthConstants";
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/pages/CreatePasswordPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext, useState } from "react";
import { Redirect, useHistory } from "react-router-dom";
import { HOME_PAGE, LOGIN_PAGE } from "../../constants/Routes";
import { HOME_PAGE } from "../../constants/Routes";
import AuthAPIClient from "../../APIClients/AuthAPIClient";
import AuthContext from "../../contexts/AuthContext";
import AUTHENTICATED_USER_KEY from "../../constants/AuthConstants";
Expand Down

0 comments on commit 7ddb407

Please sign in to comment.