Skip to content

Commit

Permalink
checked all schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
sdagg9 committed Jun 20, 2024
1 parent eaab161 commit 5375149
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/services/attendees/attendee-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ const AttendeeSchema = new mongoose.Schema({
userId: { type: String, required: true, unique: true },
name: { type: String, required: true },
email: { type: String, required: true, unique: true },
events: [{ type: mongoose.Schema.Types.ObjectId, ref: "Event" }],
events: [
{ type: mongoose.Schema.Types.ObjectId, ref: "Event", default: [] },
],
dietaryRestrictions: { type: [String], required: true },
allergies: { type: [String], required: true },
hasCheckedIn: { type: Boolean, default: false },
Expand Down
2 changes: 1 addition & 1 deletion src/services/auth/auth-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const RoleValidator = z.object({
userId: z.coerce.string().regex(/user[0-9]*/),
displayName: z.coerce.string(),
email: z.coerce.string().email(),
roles: z.array(Role),
roles: z.array(Role).default([]),
});

export const AuthRoleChangeRequest = z.object({
Expand Down
2 changes: 1 addition & 1 deletion src/services/events/events-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { v4 as uuidv4 } from "uuid";
export const EventType = z.enum(["A", "B", "C"]);

export const publicEventValidator = z.object({
eventId: z.coerce.string(),
eventId: z.coerce.string().default(() => uuidv4()),
name: z.string(),
startTime: z.coerce.date(),
endTime: z.coerce.date(),
Expand Down

0 comments on commit 5375149

Please sign in to comment.