Skip to content

Commit

Permalink
Show form error message in New Project Form (#133)
Browse files Browse the repository at this point in the history
* show form error message

* use mutation

* refactor
  • Loading branch information
Pranshu1902 authored Oct 12, 2023
1 parent 53c1307 commit 9d9a0ae
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/app/admin/projects/new/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
"use client";

import ProjectForm from "@/components/forms/projectform";
import { Button } from "@/components/ui/interactive";
import { Document, Project } from "@/types/project";
import { Project } from "@/types/project";
import { API } from "@/utils/api";
import { useMutation, useQuery } from "@tanstack/react-query";
import Link from "next/link";
import { useMutation } from "@tanstack/react-query";
import { useRouter } from "next/navigation";
import { useState } from "react";

export default function Page() {
const router = useRouter();
Expand All @@ -32,7 +29,7 @@ export default function Page() {
project={{}}
onSubmit={onSubmit}
loading={createProjectMutation.isLoading}
errors={(createProjectMutation.error as any)?.errors}
errors={(createProjectMutation.error as any)?.error}
/>
</div>
</div>
Expand Down

1 comment on commit 9d9a0ae

@vercel
Copy link

@vercel vercel bot commented on 9d9a0ae Oct 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.