File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -126,11 +126,16 @@ async function getAgreementObjects(agreementIds) {
126126
127127export 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 ( )
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ export async function createReviewPage(reviewObject) {
146146}
147147
148148export 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' )
You can’t perform that action at this time.
0 commit comments