Skip to content
New issue

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

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

Already on GitHub? # to your account

add #68

Merged
merged 1 commit into from
Mar 17, 2024
Merged

add #68

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
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