BugVilla
BugVilla copied to clipboard
Refactor: remove bug.body field and just append comment on bug creation.
In the Bug Model Instead of using bug.body for description of the bug, we can just add a comment while creating the bug that way we don't have to worry about managing two different reactions schemas.
https://github.com/anuraghazra/BugVilla/blob/2f1e6039e5c819d869fba0994b18f5d4ba0b24b1/server/models/bugModel.js#L30-L34
duplicate code introduced by current approach can be fixed:
https://github.com/anuraghazra/BugVilla/blob/2f1e6039e5c819d869fba0994b18f5d4ba0b24b1/server/controllers/BugsController.js#L334
https://github.com/anuraghazra/BugVilla/blob/2f1e6039e5c819d869fba0994b18f5d4ba0b24b1/server/controllers/CommentsController.js#L145