chore: remove duplicates

This commit is contained in:
Ephraim Atta-Duncan
2025-11-18 21:05:37 +00:00
parent 8e2ca94020
commit c8e254aff1
7 changed files with 104 additions and 107 deletions

View File

@ -1,5 +1,6 @@
import type { Envelope } from '@prisma/client';
import { type Field, type Recipient, RecipientRole, SigningStatus } from '@prisma/client';
import { z } from 'zod';
import { NEXT_PUBLIC_WEBAPP_URL } from '../constants/app';
import { extractLegacyIds } from '../universal/id';
@ -8,6 +9,18 @@ const UNKNOWN_RECIPIENT_NAME_PLACEHOLDER = '<UNKNOWN>';
export const formatSigningLink = (token: string) => `${NEXT_PUBLIC_WEBAPP_URL()}/sign/${token}`;
export const resolveRecipientEmail = (candidateEmail: string | undefined | null) => {
if (candidateEmail) {
const trimmedEmail = candidateEmail.trim();
if (z.string().email().safeParse(trimmedEmail).success) {
return trimmedEmail;
}
}
return undefined;
};
/**
* Whether a recipient can be modified by the document owner.
*/