Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapse row #165

Merged
merged 3 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions src/app/api/chapter-request/route.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,38 @@ import { z } from "zod";
questions String
*/
export const ChapterRequest = z.object({
firstName: z.string().min(1, "Please provide a first name"),
lastName: z.string().min(1, "Please provide a last name"),
universityEmail: z.string().email("This is not a valid email"),
firstName: z
.string()
.min(1, "Please provide a first name")
.max(100, "You can provide at most 100 characters"),
lastName: z
.string()
.min(1, "Please provide a last name")
.max(100, "You can provide at most 100 characters"),
universityEmail: z.string().max(100).email("Please provide a valid email"),
phoneNumber: z.string().length(10, "Phone number must be 10 digits"),
university: z.string().min(1, "Please provide a university"),
universityAddress: z.string().min(1, "Please provide an address"),
university: z
.string()
.min(1, "Please provide a university")
.max(100, "You can provide at most 100 characters"),
universityAddress: z
.string()
.min(1, "Please provide an address")
.max(100, "You can provide at most 100 characters"),
leadershipExperience: z
.string()
.min(1, "Please state some leadership experience"),
.min(1, "Please state some leadership experience")
.max(250, "You can provide at most 250 characters"),
motivation: z
.string()
.min(1, "Please describe your motivation in joining the legacy project"),
.min(1, "Please describe your motivation in joining the Legacy Project")
.max(250, "You can provide at most 250 characters"),
// TODO: Figure out if availabilities should have a better type
availabilities: z.string().min(1, "Please provide some times"),
questions: z.string(),
availabilities: z
.string()
.min(1, "Please provide some availability")
.max(100, "You can provide at most 100 characters"),
questions: z.string().max(100, "You can provide at most 100 characters"),
}) satisfies z.ZodType<Prisma.ChapterRequestCreateInput>;

export const ChapterRequestResponse = z.discriminatedUnion("code", [
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/chapter-request/route.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ describe("ChapterRequest", () => {
availabilities: "I am available",
questions: "I have a question",
})
).toThrowError("This is not a valid email");
).toThrowError("Please provide a valid email");
});
});
2 changes: 1 addition & 1 deletion src/app/public/start-chapter/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const StartChapter = () => {
<p className="py-3">
{" "}
For additional information, feel free to reach out at{" "}
<strong> [email protected] </strong>
<strong> [email protected].</strong>
</p>
</div>
<NewChapterForm />
Expand Down
Loading