Skip to content

Commit

Permalink
Merge pull request #140 from ReflectionsProjections/dev/ronit/filter-…
Browse files Browse the repository at this point in the history
…degree

Added degree to filter
  • Loading branch information
anandani4136 authored Sep 7, 2024
2 parents d0f4146 + 4e3b3f4 commit ca6a07c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/services/registration/registration-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,15 @@ registrationRouter.post(
RoleChecker([Role.Enum.STAFF, Role.Enum.CORPORATE], true),
async (req, res, next) => {
try {
const { graduations, majors, jobInterests } =
const { graduations, majors, jobInterests, degrees } =
RegistrationFilterValidator.parse(req.body);

const query = {
hasSubmitted: true,
hasResume: true,
...(graduations && { graduation: { $in: graduations } }),
...(majors && { major: { $in: majors } }),
...(degrees && { degree: { $in: degrees } }),
...(jobInterests && {
jobInterest: { $elemMatch: { $in: jobInterests } },
}),
Expand All @@ -178,6 +179,7 @@ registrationRouter.post(
name: 1,
major: 1,
graduation: 1,
degree: 1,
jobInterest: 1,
portfolios: 1,
};
Expand Down
1 change: 1 addition & 0 deletions src/services/registration/registration-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const RegistrationFilterValidator = z.object({
graduations: z.array(z.string()).optional(),
majors: z.array(z.string()).optional(),
jobInterests: z.array(z.string()).optional(),
degrees: z.array(z.string()).optional(),
});

export {
Expand Down

0 comments on commit ca6a07c

Please sign in to comment.