mirror of
https://github.com/documenso/documenso.git
synced 2025-11-19 03:01:59 +10:00
feat: use existing expiry date if available
This commit is contained in:
@ -84,6 +84,7 @@ export const AddSignersFormPartial = ({
|
||||
email: '',
|
||||
role: RecipientRole.SIGNER,
|
||||
signingOrder: 1,
|
||||
expiry: undefined,
|
||||
actionAuth: undefined,
|
||||
},
|
||||
];
|
||||
@ -100,6 +101,7 @@ export const AddSignersFormPartial = ({
|
||||
name: recipient.name,
|
||||
email: recipient.email,
|
||||
role: recipient.role,
|
||||
expiry: recipient.expired ?? undefined,
|
||||
signingOrder: recipient.signingOrder ?? index + 1,
|
||||
actionAuth:
|
||||
ZRecipientAuthOptionsSchema.parse(recipient.authOptions)?.actionAuth ?? undefined,
|
||||
@ -184,6 +186,7 @@ export const AddSignersFormPartial = ({
|
||||
email: '',
|
||||
role: RecipientRole.SIGNER,
|
||||
actionAuth: undefined,
|
||||
expiry: undefined,
|
||||
signingOrder: signers.length > 0 ? (signers[signers.length - 1]?.signingOrder ?? 0) + 1 : 1,
|
||||
});
|
||||
};
|
||||
@ -218,6 +221,7 @@ export const AddSignersFormPartial = ({
|
||||
email: user?.email ?? '',
|
||||
role: RecipientRole.SIGNER,
|
||||
actionAuth: undefined,
|
||||
expiry: undefined,
|
||||
signingOrder: signers.length > 0 ? (signers[signers.length - 1]?.signingOrder ?? 0) + 1 : 1,
|
||||
});
|
||||
}
|
||||
@ -255,6 +259,7 @@ export const AddSignersFormPartial = ({
|
||||
'email',
|
||||
'name',
|
||||
'role',
|
||||
'expiry',
|
||||
'signingOrder',
|
||||
'actionAuth',
|
||||
];
|
||||
|
||||
@ -15,6 +15,7 @@ export const ZAddSignerSchema = z.object({
|
||||
.min(1),
|
||||
name: z.string(),
|
||||
role: z.nativeEnum(RecipientRole),
|
||||
expiry: z.date().optional(),
|
||||
signingOrder: z.number().optional(),
|
||||
actionAuth: ZMapNegativeOneToUndefinedSchema.pipe(ZRecipientActionAuthTypesSchema.optional()),
|
||||
});
|
||||
|
||||
@ -63,6 +63,9 @@ export default function DocumentExpiryDialog({
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
expiry: signer.expiry,
|
||||
},
|
||||
});
|
||||
|
||||
const { mutateAsync: setSignerExpiry, isLoading } = trpc.recipient.setSignerExpiry.useMutation({
|
||||
|
||||
Reference in New Issue
Block a user