mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
🎨 🧹📝 remove todos, document typing
This commit is contained in:
@ -39,8 +39,7 @@ export default function PDFSigner(props: any) {
|
||||
}
|
||||
|
||||
function onDialogClose(dialogResult: any) {
|
||||
// todo handle signature removed from field
|
||||
// todo remove free field if dialogresult is empty (or the id )
|
||||
// todo handle signature removed from field, remove free field if dialogresult is empty (or the id )
|
||||
if (!dialogResult && dialogField.type === "FREE_SIGNATURE") {
|
||||
onDeleteHandler(dialogField.id);
|
||||
return;
|
||||
|
||||
@ -5,7 +5,6 @@ import {
|
||||
} from "@documenso/lib/server";
|
||||
import prisma from "@documenso/prisma";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import short from "short-uuid";
|
||||
import { Document as PrismaDocument, FieldType } from "@prisma/client";
|
||||
import { getDocument } from "@documenso/lib/query";
|
||||
|
||||
@ -79,7 +78,6 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
|
||||
positionX: +body.positionX,
|
||||
positionY: +body.positionY,
|
||||
customText: body.customText,
|
||||
// todo refactor only one type of recipientId
|
||||
recipientId: body.Recipient.id,
|
||||
},
|
||||
include: {
|
||||
|
||||
@ -58,8 +58,6 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
|
||||
return res.status(200).send(recipients.length);
|
||||
}
|
||||
});
|
||||
|
||||
// todo check if recipient has an account and show them in their inbox or something
|
||||
}
|
||||
|
||||
export default defaultHandler({
|
||||
|
||||
@ -37,7 +37,6 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
||||
if (!document) res.status(404).end(`No document found.`);
|
||||
|
||||
// todo rename .document to documentImageAsBase64 or sth. like that
|
||||
let documentWithInserts = document.document;
|
||||
for (const signature of signaturesFromBody) {
|
||||
if (!signature.signatureImage && !signature.typedSignature) {
|
||||
|
||||
@ -120,9 +120,6 @@ export async function getServerSideProps(context: any) {
|
||||
context.res
|
||||
);
|
||||
|
||||
// todo optimize querys
|
||||
// todo no intersection groups
|
||||
|
||||
return {
|
||||
props: {
|
||||
document: JSON.parse(JSON.stringify({ ...document, document: "" })),
|
||||
|
||||
@ -67,8 +67,6 @@ const SignPage: NextPageWithLayout = (props: any) => {
|
||||
export async function getServerSideProps(context: any) {
|
||||
const recipientToken: string = context.query["token"];
|
||||
|
||||
// todo redirect to sigend of all already signed
|
||||
|
||||
await prisma.recipient.updateMany({
|
||||
where: {
|
||||
token: recipientToken,
|
||||
@ -87,7 +85,7 @@ export async function getServerSideProps(context: any) {
|
||||
},
|
||||
});
|
||||
|
||||
// Document was already signed
|
||||
// Document is already signed
|
||||
if (recipient.Document.status === DocumentStatus.COMPLETED) {
|
||||
return {
|
||||
redirect: {
|
||||
@ -97,8 +95,7 @@ export async function getServerSideProps(context: any) {
|
||||
};
|
||||
}
|
||||
|
||||
// Clean up unsigned free place fields from UI from previous page visits
|
||||
// todo refactor free sign fields to be client side only
|
||||
// Clean up potential unsigned free place fields from UI from previous page visits
|
||||
await prisma.field.deleteMany({
|
||||
where: {
|
||||
type: { in: [FieldType.FREE_SIGNATURE] },
|
||||
|
||||
Reference in New Issue
Block a user