diff --git a/apps/web/pages/api/documents/[id]/sign.ts b/apps/web/pages/api/documents/[id]/sign.ts index 620e05fc8..c2b4e02d6 100644 --- a/apps/web/pages/api/documents/[id]/sign.ts +++ b/apps/web/pages/api/documents/[id]/sign.ts @@ -82,13 +82,26 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) { documentWithInserts = await insertTextInPDF( documentWithInserts, field.type === FieldType.DATE - ? new Date().toDateString() + ? new Intl.DateTimeFormat("en-US", { + month: "long", + day: "numeric", + year: "numeric", + }).format(new Date()) : field.customText || "", field.positionX, field.positionY, field.page, false ); + + await prisma.field.update({ + where: { + id: field.id, + }, + data: { + inserted: true, + }, + }); } await prisma.document.update({