From a763ff16c912a590694c9a48d2cc6d519d584486 Mon Sep 17 00:00:00 2001 From: Brianna Cerkiewicz Date: Tue, 8 Aug 2023 15:38:18 -0700 Subject: [PATCH] chore: cleanup --- app/components/Attachment/AttachmentTableRow.tsx | 2 -- app/components/Form/ProjectAttachmentsForm.tsx | 4 ++-- app/server/middleware/attachmentDeleteRouter.ts | 3 --- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/components/Attachment/AttachmentTableRow.tsx b/app/components/Attachment/AttachmentTableRow.tsx index 48f6c0003c..afd8182118 100644 --- a/app/components/Attachment/AttachmentTableRow.tsx +++ b/app/components/Attachment/AttachmentTableRow.tsx @@ -49,7 +49,6 @@ const AttachmentTableRow: React.FC = ({ const handleArchiveAttachment = (attachmentId) => { if (isFirstRevision) { - console.log("in if handlearchiveattachment"); hardDeleteAttachment(attachmentId, formChangeRowId); router.replace(router.asPath); } else { @@ -63,7 +62,6 @@ const AttachmentTableRow: React.FC = ({ }); } }; - console.log("connectionid", connectionId); return ( <> diff --git a/app/components/Form/ProjectAttachmentsForm.tsx b/app/components/Form/ProjectAttachmentsForm.tsx index 73fb3b98b4..65733965a2 100644 --- a/app/components/Form/ProjectAttachmentsForm.tsx +++ b/app/components/Form/ProjectAttachmentsForm.tsx @@ -28,7 +28,7 @@ const ProjectAttachmentsForm: React.FC = ({ projectRevision, onSubmit, }) => { - const brianna = useFragment( + const revision = useFragment( graphql` fragment ProjectAttachmentsForm_projectRevision on ProjectRevision { id @@ -59,7 +59,7 @@ const ProjectAttachmentsForm: React.FC = ({ projectRevision ); - const { rowId, projectAttachmentFormChanges, isFirstRevision } = brianna; + const { rowId, projectAttachmentFormChanges, isFirstRevision } = revision; const attachmentFormChange = projectAttachmentFormChanges.edges[0]?.node; const [createAttachment, isCreatingAttachment] = useCreateAttachment(); const [createProjectAttachment, isCreatingProjectAttachment] = diff --git a/app/server/middleware/attachmentDeleteRouter.ts b/app/server/middleware/attachmentDeleteRouter.ts index 414983f290..59a5ed1f6a 100644 --- a/app/server/middleware/attachmentDeleteRouter.ts +++ b/app/server/middleware/attachmentDeleteRouter.ts @@ -47,15 +47,12 @@ export const handleDelete = async (req, res, next) => { attachment: { file, id }, }, } = queryResponse; - console.log("req.body.variables", req.body.variables); // delete the form_change related to the attachment const attachmentFormChangeResponse = await performQuery( discardProjectAttachmentFormChangeMutation, req.body.variables, req ); - // brianna this isn't working since change to the discard mutation--I think this middleware isn't actually transactional. If this doesn't work the next mutation still fires - console.log("attachmentFormChangeResponse", attachmentFormChangeResponse); // delete the attachment from the attachment table const deleteAttachmentResponse = await performQuery(