We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56728c5 commit 6262119Copy full SHA for 6262119
src/server/modules/me/me.router.ts
@@ -3,13 +3,11 @@
3
* This is an example router, you can delete this file and then update `../pages/api/trpc/[trpc].tsx`
4
*/
5
import { protectedProcedure, router } from '~/server/trpc'
6
-import { defaultMeSelect } from './me.select'
7
8
export const meRouter = router({
9
get: protectedProcedure.query(async ({ ctx }) => {
10
- return await ctx.prisma.user.findUniqueOrThrow({
11
- where: { id: ctx.user.id },
12
- select: defaultMeSelect,
13
- })
+ // Remember to write a new query if you want to return something different than what
+ // the authMiddleware in protectedProcedure returns.
+ return ctx.user
14
}),
15
})
0 commit comments