𝚜𝚗𝚘𝚘𝚣𝚎
𝚜𝚗𝚘𝚘𝚣𝚎
TtRPC
Created by 𝚜𝚗𝚘𝚘𝚣𝚎 on 10/28/2024 in #❓-help
Blob as response
I know this has been mentioned couple of time but does TRPC allow returning a blob on the client from a publicProcedure.
downloadFile: baseProcedure.mutation(async () => {
const response = await ky("api/export", {
headers: {
Authorization: `Bearer ${(await cookies()).get("token")?.value}`,
},
}).blob();

return response;
}),
downloadFile: baseProcedure.mutation(async () => {
const response = await ky("api/export", {
headers: {
Authorization: `Bearer ${(await cookies()).get("token")?.value}`,
},
}).blob();

return response;
}),
This works when used with server actions from this blog https://trpc.io/blog/trpc-actions I wanted to ask if that's the case with publicProcedures too.
11 replies
TtRPC
Created by 𝚜𝚗𝚘𝚘𝚣𝚎 on 6/26/2024 in #❓-help
How do I pass FormData from client to the public procedure ?
Whilst being able to pass objects when calling mutate() from react-query's, FormData seems to not work. Logging input from public procedure results to empty object ? Any workaround ?
2 replies
TtRPC
Created by 𝚜𝚗𝚘𝚘𝚣𝚎 on 6/3/2024 in #❓-help
Next 14 app router
Is there any docs for NextJS 14 app router integration ?
22 replies