feldrok
feldrok
Explore posts from servers
TTCTheo's Typesafe Cult
Created by feldrok on 12/8/2023 in #questions
T3 Upgrade app
I can't find any guides on this, and the readme is not really clear on how to set it up
3 replies
TTCTheo's Typesafe Cult
Created by Pavstermeister on 11/5/2023 in #questions
Configuring Clerk on the latest release of t3 with tRPC
Still can't figure this out 😦
123 replies
TTCTheo's Typesafe Cult
Created by Pavstermeister on 11/5/2023 in #questions
Configuring Clerk on the latest release of t3 with tRPC
I need to do this too
123 replies
TTCTheo's Typesafe Cult
Created by Deniz on 5/9/2023 in #questions
create t3 app for nextjs 13.4 app dir
im hoping for a guide on how to upgrade from pages to appdir
6 replies
TTCTheo's Typesafe Cult
Created by feldrok on 3/15/2023 in #questions
tRPC API endpoints?
you are right, fixed that
16 replies
TTCTheo's Typesafe Cult
Created by feldrok on 3/15/2023 in #questions
tRPC API endpoints?
i understand, but why getting this when i define the output? i dont get where that is coming from
16 replies
TTCTheo's Typesafe Cult
Created by feldrok on 3/15/2023 in #questions
tRPC API endpoints?
i get this when not passing .output()
16 replies
TTCTheo's Typesafe Cult
Created by feldrok on 3/15/2023 in #questions
tRPC API endpoints?
16 replies
TTCTheo's Typesafe Cult
Created by feldrok on 3/15/2023 in #questions
tRPC API endpoints?
even though its succesfully posting
16 replies
TTCTheo's Typesafe Cult
Created by feldrok on 3/15/2023 in #questions
tRPC API endpoints?
16 replies
TTCTheo's Typesafe Cult
Created by feldrok on 3/15/2023 in #questions
tRPC API endpoints?
import { createTRPCRouter, protectedProcedure, publicProcedure, } from "~/server/api/trpc"; import bcryptjs from "bcryptjs"; import { z } from "zod"; export const userRouter = createTRPCRouter({ create: publicProcedure .meta({ openapi: { method: "POST", path: "/test/create" } }) .input( z.object({ rut: z.string(), name: z.string(), paternallastname: z.string(), maternallastname: z.string(), email: z.string(), phone: z.string(), address: z.string(), district: z.string(), password: z.string(), }) ) .output( z.object({ message: z.string(), person: z.object({ id: z.number(), rut: z.string(), name: z.string(), paternallastname: z.string(), maternallastname: z.string(), email: z.string(), phone: z.string(), address: z.string(), district: z.string(), }), user: z.object({ id: z.number(), person_id: z.number(), hash: z.string(), }), }) ) .query(async ({ ctx, input }) => { const newPerson = await ctx.prisma.person.create({ data: { rut: input.rut, name: input.name, paternallastname: input.paternallastname, maternallastname: input.maternallastname, email: input.email, phone: input.phone, address: input.address, district: input.district, }, }); const hashedPassword = bcryptjs.hashSync(input.password, 10); const newUser = await ctx.prisma.user.create({ data: { person_id: newPerson.id, hash: hashedPassword, }, }); return { message: "User created", person: newPerson, user: newUser, }; }), });
16 replies
TTCTheo's Typesafe Cult
Created by feldrok on 3/15/2023 in #questions
tRPC API endpoints?
thanks, i've done something at it's "working"
16 replies
TTCTheo's Typesafe Cult
Created by feldrok on 3/9/2023 in #questions
Error after clean setup of T3-TURBO-CLERK
Thanks for your swift answer James, nice to meet you, I'll try to open a github issue in a few days when I get back home, thanks again.
4 replies