mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
fix: default to user timezone (#1559)
Passes the timezone of the user uploading the document/template via the UI to the server. If the user uploads a document/template via the API and doesn't set a timezone, it defaults to `Etc/UTC`.
This commit is contained in:
@ -181,7 +181,7 @@ export const documentRouter = router({
|
||||
.input(ZCreateDocumentMutationSchema)
|
||||
.output(ZCreateDocumentResponseSchema)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
const { title, documentDataId, teamId } = input;
|
||||
const { title, documentDataId, teamId, timezone } = input;
|
||||
|
||||
const { remaining } = await getServerLimits({ email: ctx.user.email, teamId });
|
||||
|
||||
@ -198,6 +198,7 @@ export const documentRouter = router({
|
||||
title,
|
||||
documentDataId,
|
||||
normalizePdf: true,
|
||||
timezone,
|
||||
requestMetadata: extractNextApiRequestMetadata(ctx.req),
|
||||
});
|
||||
}),
|
||||
|
||||
@ -66,6 +66,7 @@ export const ZCreateDocumentMutationSchema = z.object({
|
||||
title: z.string().min(1),
|
||||
documentDataId: z.string().min(1),
|
||||
teamId: z.number().optional(),
|
||||
timezone: z.string().optional(),
|
||||
});
|
||||
|
||||
export type TCreateDocumentMutationSchema = z.infer<typeof ZCreateDocumentMutationSchema>;
|
||||
|
||||
Reference in New Issue
Block a user