Skip to content

Commit 5fec98e

Browse files
committed
fix(internal): 🔥 Properly remove all references to the template "post" data
1 parent 39f4144 commit 5fec98e

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed
Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
"use client";
1+
// "use client";
22

3-
import { useRouter } from "next/navigation";
4-
import { useState } from "react";
3+
// import { useRouter } from "next/navigation";
4+
// import { useState } from "react";
55

6-
import { api } from "~/trpc/react";
6+
// import { api } from "~/trpc/react";
77

8-
export function CreatePost() {
9-
const router = useRouter();
10-
const [name, setName] = useState("");
8+
// export function CreatePost() {
9+
// const router = useRouter();
10+
// const [name, setName] = useState("");
1111

12-
const createPost = api.post.create.useMutation({
13-
onSuccess: () => {
14-
router.refresh();
15-
setName("");
16-
},
17-
});
12+
// const createPost = api.post.create.useMutation({
13+
// onSuccess: () => {
14+
// router.refresh();
15+
// setName("");
16+
// },
17+
// });
1818

19-
return (
20-
<form
21-
onSubmit={(e) => {
22-
e.preventDefault();
23-
createPost.mutate({ name });
24-
}}
25-
className="flex flex-col gap-2"
26-
>
27-
<input
28-
type="text"
29-
placeholder="Title"
30-
value={name}
31-
onChange={(e) => setName(e.target.value)}
32-
className="w-full rounded-full px-4 py-2 text-black"
33-
/>
34-
<button
35-
type="submit"
36-
className="rounded-full bg-white/10 px-10 py-3 font-semibold transition hover:bg-white/20"
37-
disabled={createPost.isPending}
38-
>
39-
{createPost.isPending ? "Submitting..." : "Submit"}
40-
</button>
41-
</form>
42-
);
43-
}
19+
// return (
20+
// <form
21+
// onSubmit={(e) => {
22+
// e.preventDefault();
23+
// createPost.mutate({ name });
24+
// }}
25+
// className="flex flex-col gap-2"
26+
// >
27+
// <input
28+
// type="text"
29+
// placeholder="Title"
30+
// value={name}
31+
// onChange={(e) => setName(e.target.value)}
32+
// className="w-full rounded-full px-4 py-2 text-black"
33+
// />
34+
// <button
35+
// type="submit"
36+
// className="rounded-full bg-white/10 px-10 py-3 font-semibold transition hover:bg-white/20"
37+
// disabled={createPost.isPending}
38+
// >
39+
// {createPost.isPending ? "Submitting..." : "Submit"}
40+
// </button>
41+
// </form>
42+
// );
43+
// }

‎src/server/api/root.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { postRouter } from "~/server/api/routers/post";
1+
//import { postRouter } from "~/server/api/routers/post";
22
import { createCallerFactory, createTRPCRouter } from "~/server/api/trpc";
33

44
/**
@@ -7,7 +7,7 @@ import { createCallerFactory, createTRPCRouter } from "~/server/api/trpc";
77
* All routers added in /api/routers should be manually added here.
88
*/
99
export const appRouter = createTRPCRouter({
10-
post: postRouter,
10+
//post: postRouter,
1111
});
1212

1313
// export type definition of API

0 commit comments

Comments
 (0)