Skip to content

Commit

Permalink
Fixed updating blob name of attachment when validation failed (#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tolik170 authored Sep 12, 2023
1 parent 3561f00 commit e8d82f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion services/attachment.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ const attachmentService = {
const [fileExtension] = attachment.fileName.split('.').reverse()
const newFileName = `${fileName}.${fileExtension}`

attachment.fileName = newFileName

await attachment.validate()

const newLink = await uploadService.updateFile(attachment.link, newFileName, ATTACHMENT)

attachment.fileName = newFileName
attachment.link = newLink
}

Expand Down

0 comments on commit e8d82f5

Please sign in to comment.