Skip to content

Commit

Permalink
Merge pull request #68 from NishantGupt786/master
Browse files Browse the repository at this point in the history
add
  • Loading branch information
NishantGupt786 committed Mar 17, 2024
2 parents 186f097 + 87958dd commit 3a8edb3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions devsoc24-portal-fe/src/app/edit-project/edit-subject-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { useRouter } from "next/navigation";
import { type APIResponse } from "@/schemas/api";

interface FormValues {
title: string;
name: string;
track: string;
description: string;
figma_link?: string;
Expand Down Expand Up @@ -84,7 +84,7 @@ export default function EditProjectForm() {
const form = useForm<FormValues>({
resolver: zodResolver(ideaSchema),
defaultValues: {
title: "",
name: "",
track: "",
description: "",
figma_link: "",
Expand Down Expand Up @@ -137,7 +137,7 @@ export default function EditProjectForm() {
<div>
<FormField
control={form.control}
name="title"
name="name"
render={({ field }) => (
<FormItem>
<FormControl>
Expand All @@ -153,7 +153,7 @@ export default function EditProjectForm() {
type="text"
{...field}
className={`h-14 bg-white pl-5 ${
form.getFieldState("title").invalid
form.getFieldState("name").invalid
? "border-red-500 focus:border-input focus:!ring-red-500"
: ""
}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import axios, { AxiosError } from "axios";
import ToastContainer from "@/components/ToastContainer";
import { useRouter } from "next/navigation";
interface FormValues {
title: string;
name: string;
track: string;
description: string;
figma_link: string;
Expand Down Expand Up @@ -48,7 +48,7 @@ export default function SubmitProjectForm() {
const form = useForm<FormValues>({
resolver: zodResolver(ideaSchema),
defaultValues: {
title: "",
name: "",
track: "",
description: "",
figma_link: "",
Expand Down Expand Up @@ -101,7 +101,7 @@ export default function SubmitProjectForm() {
<div>
<FormField
control={form.control}
name="title"
name="name"
render={({ field }) => (
<FormItem>
<FormControl>
Expand All @@ -119,7 +119,7 @@ export default function SubmitProjectForm() {
{...field}
placeholder="Shuttle tracker"
className={`h-14 bg-white pl-5 ${
form.getFieldState("title").invalid
form.getFieldState("name").invalid
? "border-red-500 focus:border-input focus:!ring-red-500"
: ""
}`}
Expand Down
2 changes: 1 addition & 1 deletion devsoc24-portal-fe/src/schemas/idea.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as z from "zod";

export const ideaSchema = z.object({
title: z
name: z
.string({
required_error: "Project name is required",
invalid_type_error: "Project must be a string",
Expand Down

0 comments on commit 3a8edb3

Please sign in to comment.