MCPcopy Create free account
hub / github.com/RealDevSquad/website-backend / rejectProfileDiff

Function rejectProfileDiff

controllers/users.js:842–866  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

840 logger.error(`Internal Server Error: ${error}`);
841 return res.boom.badImplementation(INTERNAL_SERVER_ERROR);
842 }
843};
844
845const 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};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected