mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
Adds the missing endpoints for documents, envelopes and templates supporting file uploads in a singular request. Also updates frontend components that would use the prior hidden endpoints.
18 lines
484 B
TypeScript
18 lines
484 B
TypeScript
import type { DataTransformer } from '@trpc/server';
|
|
import SuperJSON from 'superjson';
|
|
|
|
export const dataTransformer: DataTransformer = {
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
serialize: (data: any) => {
|
|
if (data instanceof FormData) {
|
|
return data;
|
|
}
|
|
|
|
return SuperJSON.serialize(data);
|
|
},
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
deserialize: (data: any) => {
|
|
return SuperJSON.deserialize(data);
|
|
},
|
|
};
|