Skip to content

Commit fd344b2

Browse files
RahulGoyal-techbyt3quester
authored andcommitted
Added dev feature flag
1 parent 5cce003 commit fd344b2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

controllers/users.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,14 @@ const getUserImageForVerification = async (req, res) => {
653653
const updateUser = async (req, res) => {
654654
try {
655655
const { id: profileDiffId, message } = req.body;
656-
657-
const profileDiffData = await profileDiffsQuery.fetchProfileDiffUnobfuscated(profileDiffId);
656+
const devFeatureFlag = req.query.dev;
657+
let profileDiffData;
658+
if (devFeatureFlag === "true") {
659+
profileDiffData = await profileDiffsQuery.fetchProfileDiffUnobfuscated(profileDiffId);
660+
} else {
661+
profileDiffData = await profileDiffsQuery.fetchProfileDiff(profileDiffId);
662+
}
663+
Object.freeze(profileDiffData);
658664
if (!profileDiffData) return res.boom.notFound("Profile Diff doesn't exist");
659665

660666
const { approval, timestamp, userId, ...profileDiff } = profileDiffData;

0 commit comments

Comments
 (0)