Skip to content
Snippets Groups Projects
Commit bfdf11d6 authored by Andrei Cioromila's avatar Andrei Cioromila
Browse files

feature(components): delete files only when they have been assigned on the manuscript

parent aae3e5c8
No related branches found
No related tags found
2 merge requests!136Sprint 22 features (updates),!125HIN-1066
...@@ -64,7 +64,7 @@ module.exports = models => async (req, res) => { ...@@ -64,7 +64,7 @@ module.exports = models => async (req, res) => {
fragmentId, fragmentId,
).map(file => file.id) ).map(file => file.id)
if (fileKeys.length !== 0) { if (fileKeys.length > 1) {
await deleteFilesS3({ fileKeys, s3Config }) await deleteFilesS3({ fileKeys, s3Config })
} }
...@@ -72,7 +72,7 @@ module.exports = models => async (req, res) => { ...@@ -72,7 +72,7 @@ module.exports = models => async (req, res) => {
await collection.delete() await collection.delete()
return res.status(200).json() return res.status(204).send()
} catch (e) { } catch (e) {
const notFoundError = await services.handleNotFoundError(e, 'Item') const notFoundError = await services.handleNotFoundError(e, 'Item')
return res.status(notFoundError.status).json({ return res.status(notFoundError.status).json({
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment