Skip to content

Commit

Permalink
Fix merge conflict errors + lint
Browse files Browse the repository at this point in the history
  • Loading branch information
carolynzhang18 committed Nov 18, 2024
1 parent 5f218d9 commit 574f86d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
7 changes: 5 additions & 2 deletions backend/models/user.mgmodel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import mongoose, { Schema, Document, ObjectId } from "mongoose";

import { FacilitatorDTO, Role, Status } from "../types/userTypes";
import { Role, Status } from "../types/userTypes";

export interface User extends Document {
id: ObjectId;
Expand Down Expand Up @@ -87,7 +87,10 @@ const Administrator = UserModel.discriminator(
"Administrator",
AdministratorSchema,
);
const FacilitatorModel = UserModel.discriminator<Facilitator>("Facilitator", FacilitatorSchema);
const FacilitatorModel = UserModel.discriminator<Facilitator>(
"Facilitator",
FacilitatorSchema,
);
const LearnerModel = UserModel.discriminator<Learner>("Learner", LearnerSchema);

export { Administrator, FacilitatorModel, LearnerModel };
Expand Down
24 changes: 13 additions & 11 deletions backend/rest/authRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
updateTemporaryPasswordRequestValidator,
updateUserStatusRequestValidator,
} from "../middlewares/validators/authValidators";
import * as firebaseAdmin from "firebase-admin"
import nodemailerConfig from "../nodemailer.config";
import AuthService from "../services/implementations/authService";
import EmailService from "../services/implementations/emailService";
Expand Down Expand Up @@ -208,24 +207,27 @@ authRouter.post(
length: 20,
numbers: true,
});
const invitedLearnerUser = await userService.createLearner({
firstName: req.body.firstName,
lastName: req.body.lastName,
email: req.body.email,
role: "Learner",
password: temporaryPassword,
status: "Invited",
}, id);
const invitedLearnerUser = await userService.createLearner(
{
firstName: req.body.firstName,
lastName: req.body.lastName,
email: req.body.email,
role: "Learner",
password: temporaryPassword,
status: "Invited",
},
req.body.facilitatorId,
);
await authService.sendLearnerInvite(
req.body.firstName,
req.body.email,
temporaryPassword
temporaryPassword,
);
res.status(200).json(invitedLearnerUser);
} catch (error: unknown) {
res.status(500).json({ error: getErrorMessage(error) });
}
}
},
);

// /* Reset password through a "Forgot Password" option */
Expand Down
1 change: 1 addition & 0 deletions backend/services/implementations/userService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
CreateUserDTO,
LearnerDTO,
Role,
Status,
UpdateUserDTO,
UserDTO,
} from "../../types/userTypes";
Expand Down
1 change: 0 additions & 1 deletion frontend/src/theme/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { TypographyStyleOptions } from "@mui/material/styles/createTypography";
import { error, learner, administrator, facilitator, neutral } from "./palette";
import "@fontsource/lexend-deca";


// adding custom attributes to palette
declare module "@mui/material/styles" {
// allow configuration using `createTheme`
Expand Down

0 comments on commit 574f86d

Please sign in to comment.