Skip to content
Snippets Groups Projects
Commit c64f1e61 authored by Tania Fecheta's avatar Tania Fecheta
Browse files

refactor(collection/patch): remove duplcate code and unnecesary code

parent 26eda51d
No related branches found
No related tags found
3 merge requests!222Sprint #26,!217Sprint #26,!198Hin 1166 admin delete manuscript
......@@ -35,12 +35,9 @@ module.exports = models => async (req, res) => {
})
}
if (collectionStatus) {
collection.status = 'deleted'
await collection.save()
const collectionHelper = new Collection({ collection })
collectionHelper.updateStatus({ newStatus: 'deleted' })
}
const collectionHelper = new Collection({ collection })
await collectionHelper.updateStatus({ newStatus: 'deleted' })
return res.status(200).json(collection)
} catch (e) {
const notFoundError = await services.handleNotFoundError(e, 'Collection')
......
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