feat: allow multipart requests for public api

Adds support for multipart/form-data requests in the public api
allowing documents to be uploaded without having to perform a secondary
request.

Need to rollout further endpoints for envelopes and templates.

Need to change how we store files to not use `putFileServerSide`
This commit is contained in:
Lucas Smith
2025-11-02 23:26:43 +11:00
parent 47bdcd833f
commit c85c0cf610
19 changed files with 1154 additions and 252 deletions
+15
View File
@@ -0,0 +1,15 @@
import type { DataTransformer } from '@trpc/server';
import SuperJSON from 'superjson';
export const dataTransformer: DataTransformer = {
serialize: (data: unknown) => {
if (data instanceof FormData) {
return data;
}
return SuperJSON.serialize(data);
},
deserialize: (data: unknown) => {
return SuperJSON.deserialize(data);
},
};