DINO
DINO
TtRPC
Created by DINO on 9/1/2024 in #❓-help
How do I create a React/Node full-stack project with tRPC?
Thank you very much. @Gabriel @MadaShindeInai
9 replies
TtRPC
Created by DINO on 9/1/2024 in #❓-help
How do I create a React/Node full-stack project with tRPC?
yeah I don't want to use Next.js, sorry what did you mean with this setup?
9 replies
TtRPC
Created by DINO on 2/19/2024 in #❓-help
useMutation() runs 3 times
I have solved it. It was calling createIPCHandler multiple times. Thank you very much for your time.
14 replies
TtRPC
Created by DINO on 2/19/2024 in #❓-help
useMutation() runs 3 times
I think I found where the problem at. I am using Electron with electron-trpc and I guess it's from create createIPCHandler handler multiple times.
14 replies
TtRPC
Created by DINO on 2/19/2024 in #❓-help
useMutation() runs 3 times
It succeeds 3 times
14 replies
TtRPC
Created by DINO on 2/19/2024 in #❓-help
useMutation() runs 3 times
Also it's not a problem of the the way I create new row because I tried to console.log() at the start of the mutation function and it turned out it runs 3 times.
const create = t.procedure.input(brandFormSchema).mutation(async (req) => {
try {
console.log('=== running create brand mutation')
const { input: brandFormValues } = req
const em = orm.em.fork()
await em.persistAndFlush(em.create(Brand, brandFormValues))
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
createErrorLog(err.message, 'Create brand.')
throw err
}
})
const create = t.procedure.input(brandFormSchema).mutation(async (req) => {
try {
console.log('=== running create brand mutation')
const { input: brandFormValues } = req
const em = orm.em.fork()
await em.persistAndFlush(em.create(Brand, brandFormValues))
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
createErrorLog(err.message, 'Create brand.')
throw err
}
})
14 replies
TtRPC
Created by TaylorFay on 1/12/2024 in #❓-help
trpc output dates are typed as strings and not dates
Yes I have solved it with superjson
9 replies
TtRPC
Created by TaylorFay on 1/12/2024 in #❓-help
trpc output dates are typed as strings and not dates
I have the same problem using electron-trpc
9 replies