(req, res)
| 840 | logger.error(`Internal Server Error: ${error}`); |
| 841 | return res.boom.badImplementation(INTERNAL_SERVER_ERROR); |
| 842 | } |
| 843 | }; |
| 844 | |
| 845 | const rejectProfileDiff = async (req, res) => { |
| 846 | try { |
| 847 | const { profileDiffId, message } = req.body; |
| 848 | const profileResponse = await profileDiffsQuery.updateProfileDiff( |
| 849 | { approval: profileDiffStatus.REJECTED }, |
| 850 | profileDiffId, |
| 851 | ); |
| 852 | |
| 853 | if (profileResponse.notFound) return res.boom.notFound("Profile Diff doesn't exist"); |
| 854 | |
| 855 | const meta = { |
| 856 | rejectedBy: req.userData.id, |
| 857 | userId: profileResponse.userId, |
| 858 | }; |
| 859 | |
| 860 | await logsQuery.addLog(logType.PROFILE_DIFF_REJECTED, meta, { profileDiffId, message }); |
| 861 | |
| 862 | return res.json({ |
| 863 | message: "Profile Diff Rejected successfully!", |
| 864 | }); |
| 865 | } catch (error) { |
| 866 | logger.error(`Error while rejecting profile diff: ${error}`); |
| 867 | return res.boom.badImplementation(INTERNAL_SERVER_ERROR); |
| 868 | } |
| 869 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected