Skip to content

Commit

Permalink
Merge pull request #49 from NishantGupt786/master
Browse files Browse the repository at this point in the history
hello
  • Loading branch information
NishantGupt786 authored Mar 15, 2024
2 parents ccaaeaa + 856528b commit e739e20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion devsoc24-portal-fe/src/schemas/idea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ export const ideaSchema = z.object({
invalid_type_error: "Project must be a string",
})
.max(30, "Title cannot be longer than 50 characters")
.refine((value) => value.trim().length > 0, {
.refine((value) => value.trim().length > 1, {
message: "Title must not be empty",
})
.refine((value) => value.trim().length > 100, {
message: "Invalid title",
}),

track: z.string({
Expand All @@ -30,6 +33,7 @@ export const ideaSchema = z.object({
.string({
invalid_type_error: "Figma Link be a string",
})
.min(10, "Figma link must be a url")
.max(200, "Figma link cannot be longer than 100 characters")
.url("Figma link must be a url")
.optional()
Expand All @@ -39,6 +43,7 @@ export const ideaSchema = z.object({
.string({
invalid_type_error: "Github Link be a string",
})
.min(10, "Github link must be a url")
.max(100, "Github link cannot be longer than 100 characters")
.url("Github link must be a url")
.optional()
Expand All @@ -49,6 +54,7 @@ export const ideaSchema = z.object({
required_error: "Other Links is required",
invalid_type_error: "Other Links be a string",
})
.min(10, "Other links must be a url")
.max(100, "Other links cannot be longer than 200 characters")
.refine((value) => value.trim().length > 0, {
message: "Others must not be empty",
Expand Down
2 changes: 1 addition & 1 deletion devsoc24-portal-fe/src/schemas/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const profileSchema = z.object({
.string({
required_error: "Last Name is required",
invalid_type_error: "Last Name must be a string",
})
}).min(3, "Last Name must be at least 3 characters long")
.max(20, "Last Name cannot be longer than 20 characters")
.refine((value) => value.trim().length > 0, {
message: "Last Name must not be empty",
Expand Down

0 comments on commit e739e20

Please sign in to comment.