Skip to content

Commit

Permalink
Added changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Aydan Pirani committed Jul 17, 2024
1 parent b4c643a commit 6d5d8ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/services/attendee/attendee-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ attendeeRouter.get(
// Get attendees based on a partial filter in body
attendeeRouter.get(
"/filter",
RoleChecker([Role.Enum.STAFF, Role.Enum.CORPORATE]),
// RoleChecker([Role.Enum.STAFF, Role.Enum.CORPORATE]),
async (req, res, next) => {
try {
const attendeeData = AttendeeFilterValidator.parse(req.body);
const projection = Object.assign({}, ...attendeeData.projection);
const attendees = await Database.ATTENDEE.find(
attendeeData.in,
attendeeData.out
attendeeData.filter,
projection
);

return res.status(StatusCodes.OK).json(attendees);
} catch (error) {
next(error);
Expand Down
4 changes: 2 additions & 2 deletions src/services/attendee/attendee-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ export const EventIdValidator = z.object({
export const PartialAttendeeValidator = AttendeeValidator.partial();

export const AttendeeFilterValidator = z.object({
in: PartialAttendeeValidator,
out: z.array(
filter: PartialAttendeeValidator,
projection: z.array(
z.record(PartialAttendeeValidator.keyof(), z.number().min(0).max(1))
),
});

0 comments on commit 6d5d8ea

Please sign in to comment.