File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
apps/cli/templates/auth/web/react/next/src/app/dashboard Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " create-better-t-stack " : patch
3
+ ---
4
+
5
+ Show privateData only for selected API in dashboard template
Original file line number Diff line number Diff line change 1
1
"use client"
2
2
import { authClient } from "@/lib/auth-client";
3
3
{{ #if (eq api " orpc" )}}
4
+ import { useQuery } from "@tanstack/react-query";
4
5
import { orpc } from "@/utils/orpc";
5
6
{{ /if }}
6
7
{{ #if (eq api " trpc" )}}
8
+ import { useQuery } from "@tanstack/react-query";
7
9
import { trpc } from "@/utils/trpc";
8
10
{{ /if }}
9
- import { useQuery } from "@tanstack/react-query";
10
11
import { useRouter } from "next/navigation";
11
12
import { useEffect } from "react";
12
13
13
14
export default function Dashboard() {
14
- const router = useRouter()
15
+ const router = useRouter();
15
16
const { data: session, isPending } = authClient.useSession();
16
17
17
18
{{ #if (eq api " orpc" )}}
@@ -35,7 +36,12 @@ export default function Dashboard() {
35
36
<div >
36
37
<h1 >Dashboard</h1 >
37
38
<p >Welcome {session?.user.name}</p >
39
+ {{ #if (eq api " orpc" )}}
40
+ <p >privateData: {privateData.data?.message}</p >
41
+ {{ /if }}
42
+ {{ #if (eq api " trpc" )}}
38
43
<p >privateData: {privateData.data?.message}</p >
44
+ {{ /if }}
39
45
</div >
40
46
);
41
47
}
You can’t perform that action at this time.
0 commit comments