behavedB
tRPC11mo ago
4 replies
behaved

operation input is formdata but trpc makes it an application/json POST call

operation:
{
    "type": "mutation",
    "path": "vectleProfiles.updateProfileLogo",
    "input": {},
    "context": {},
    "id": 4
}



request headers:

accept:
*/*
accept-encoding:
gzip, deflate, br, zstd
accept-language:
en-US,en;q=0.9
connection:
keep-alive
content-length:
11
content-type:
application/json


sample router

publicProcedure
    .input(z.instanceof(FormData))
    .mutation(async ({ input, ctx }) => {
     ...
    }),
Was this page helpful?