Skip to content

Commit 5c6aa5a

Browse files
committed
Debug deleting attachments
1 parent d841cfc commit 5c6aa5a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

backend/src/controllers/AttachmentController.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,16 @@ async function getAgreementObjects(agreementIds) {
126126

127127
export async function deleteAttachment(req, res) {
128128
const attachmentId = req.params.id
129+
logger.info('Delete attachment', { attachmentId })
129130
const attachment = await attachmentService.getAttachments([attachmentId])
131+
logger.info('Attachment', attachment)
130132
const agreement = await agreementService.getAgreementById(attachment[0].agreementId)
133+
logger.info('Agreement', agreement)
131134
await checkUserHasRightToModifyAgreement(req, [agreement])
135+
logger.info('Access success')
132136

133137
const deletedId = await attachmentService.deleteAttachment(attachmentId)
138+
logger.info('Attachment deleted', { deletedId })
134139
notificationService.createNotification('ATTACHMENT_DELETE_ONE_SUCCESS', req)
135140

136141
res.status(200).send(deletedId).end()

backend/src/services/AttachmentService.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export async function createReviewPage(reviewObject) {
146146
}
147147

148148
export async function deleteAttachment(attachmentId) {
149+
logger.info('Deleting attachment', { attachmentId })
149150
// Do not delete the file for now.
150151
// TODO: Add timed file removal (after indexing has ended, 30 days?)
151152
return knex('attachment')

0 commit comments

Comments
 (0)