Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
BCerki committed Aug 8, 2023
1 parent 4b4756e commit c862343
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 0 additions & 2 deletions app/components/Attachment/AttachmentTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const AttachmentTableRow: React.FC<Props> = ({

const handleArchiveAttachment = (attachmentId) => {
if (isFirstRevision) {
console.log("in if handlearchiveattachment");
hardDeleteAttachment(attachmentId, formChangeRowId);
router.replace(router.asPath);
} else {
Expand All @@ -63,7 +62,6 @@ const AttachmentTableRow: React.FC<Props> = ({
});
}
};
console.log("connectionid", connectionId);
return (
<>
<tr>
Expand Down
4 changes: 2 additions & 2 deletions app/components/Form/ProjectAttachmentsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ProjectAttachmentsForm: React.FC<Props> = ({
projectRevision,
onSubmit,
}) => {
const brianna = useFragment(
const revision = useFragment(
graphql`
fragment ProjectAttachmentsForm_projectRevision on ProjectRevision {
id
Expand Down Expand Up @@ -59,7 +59,7 @@ const ProjectAttachmentsForm: React.FC<Props> = ({
projectRevision
);

const { rowId, projectAttachmentFormChanges, isFirstRevision } = brianna;
const { rowId, projectAttachmentFormChanges, isFirstRevision } = revision;
const attachmentFormChange = projectAttachmentFormChanges.edges[0]?.node;
const [createAttachment, isCreatingAttachment] = useCreateAttachment();
const [createProjectAttachment, isCreatingProjectAttachment] =
Expand Down
3 changes: 0 additions & 3 deletions app/server/middleware/attachmentDeleteRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c862343

Please sign in to comment.