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
This commit is part of merge request !198. Comments created here will be created in the context of that merge request.
...@@ -35,12 +35,9 @@ module.exports = models => async (req, res) => { ...@@ -35,12 +35,9 @@ module.exports = models => async (req, res) => {
}) })
} }
if (collectionStatus) { const collectionHelper = new Collection({ collection })
collection.status = 'deleted' await collectionHelper.updateStatus({ newStatus: 'deleted' })
await collection.save()
const collectionHelper = new Collection({ collection })
collectionHelper.updateStatus({ newStatus: 'deleted' })
}
return res.status(200).json(collection) return res.status(200).json(collection)
} catch (e) { } catch (e) {
const notFoundError = await services.handleNotFoundError(e, 'Collection') 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