feat(challenges): even more slur blocker

This commit is contained in:
CuriousMagpie
2023-11-14 15:46:16 -05:00
parent e5e91aa78a
commit a771045ca7
2 changed files with 3 additions and 3 deletions
@@ -225,7 +225,7 @@ api.createChallenge = {
const validationErrors = req.validationErrors();
if (validationErrors) throw validationErrors;
const { group } = (user, req, req);
const { savedChal, group } = await createChallenge(user, req, res);
// checks challenge for slurs and banned words
if (group.privacy === 'public'
@@ -236,7 +236,7 @@ api.createChallenge = {
throw new BadRequest(res.t('challengeBannedWordsAndSlurs'));
}
const { savedChal } = await createChallenge(user, req, res);
await user.save();
const response = savedChal.toJSON();
response.leader = { // the leader is the authenticated user